mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-13 18:46:57 +02:00
[BUG] buffers: buffer_forward() must not always clear BF_OUT_EMPTY
This flag was unconditionally cleared, which is wrong because we can enable forwarding on an empty buffer.
This commit is contained in:
parent
269358db93
commit
2d028db75a
@ -91,14 +91,17 @@ static inline void buffer_forward(struct buffer *buf, unsigned long bytes)
|
|||||||
|
|
||||||
if (!bytes)
|
if (!bytes)
|
||||||
return;
|
return;
|
||||||
buf->flags &= ~BF_OUT_EMPTY;
|
|
||||||
data_left = buf->l - buf->send_max;
|
data_left = buf->l - buf->send_max;
|
||||||
if (data_left >= bytes) {
|
if (data_left >= bytes) {
|
||||||
buf->send_max += bytes;
|
buf->send_max += bytes;
|
||||||
|
buf->flags &= ~BF_OUT_EMPTY;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
buf->send_max += data_left;
|
buf->send_max += data_left;
|
||||||
|
if (buf->send_max)
|
||||||
|
buf->flags &= ~BF_OUT_EMPTY;
|
||||||
|
|
||||||
if (buf->to_forward == BUF_INFINITE_FORWARD)
|
if (buf->to_forward == BUF_INFINITE_FORWARD)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user