mirror of
https://github.com/haproxy/haproxy.git
synced 2026-02-18 18:19:39 -05:00
MEDIUM: stream: Offer buffers of default size only
Check the channels buffers size on release before trying to offer it to waiting entities. Only normal buffers must be considered. This will be mandatory when the large buffers support on channels will be added.
This commit is contained in:
parent
bc586b4138
commit
e62e8de5a7
1 changed files with 5 additions and 3 deletions
|
|
@ -658,7 +658,7 @@ void stream_free(struct stream *s)
|
|||
b_dequeue(&s->buffer_wait);
|
||||
|
||||
if (s->req.buf.size || s->res.buf.size) {
|
||||
int count = !!s->req.buf.size + !!s->res.buf.size;
|
||||
int count = (s->req.buf.size == global.tune.bufsize) + (s->res.buf.size == global.tune.bufsize);
|
||||
|
||||
b_free(&s->req.buf);
|
||||
b_free(&s->res.buf);
|
||||
|
|
@ -807,11 +807,13 @@ void stream_release_buffers(struct stream *s)
|
|||
int offer = 0;
|
||||
|
||||
if (c_size(&s->req) && c_empty(&s->req)) {
|
||||
offer++;
|
||||
if (c_size(&s->req) == global.tune.bufsize)
|
||||
offer++;
|
||||
b_free(&s->req.buf);
|
||||
}
|
||||
if (c_size(&s->res) && c_empty(&s->res)) {
|
||||
offer++;
|
||||
if (c_size(&s->res) == global.tune.bufsize)
|
||||
offer++;
|
||||
b_free(&s->res.buf);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue