From: Willy Tarreau Date: Wed, 23 Sep 2009 21:47:55 +0000 (+0200) Subject: [MINOR] ensure that buffer_feed() and buffer_skip() set BF_*_PARTIAL X-Git-Tag: v1.4-dev3~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb0e9209a905e4e4fe1b913bd0d912066fcc3a2c;p=thirdparty%2Fhaproxy.git [MINOR] ensure that buffer_feed() and buffer_skip() set BF_*_PARTIAL It's important that these functions set these flags themselves, otherwise the callers will always have to do this, and there is no valid reason for not doing it. --- diff --git a/include/proto/buffers.h b/include/proto/buffers.h index 432146c92c..ab47b4f7cb 100644 --- a/include/proto/buffers.h +++ b/include/proto/buffers.h @@ -349,6 +349,9 @@ static inline void buffer_skip(struct buffer *buf, int len) buf->send_max -= len; if (!buf->send_max && !buf->pipe) buf->flags |= BF_OUT_EMPTY; + + /* notify that some data was written to the SI from the buffer */ + buf->flags |= BF_WRITE_PARTIAL; } /* diff --git a/src/buffers.c b/src/buffers.c index a21eb4f33e..dd5c00339e 100644 --- a/src/buffers.c +++ b/src/buffers.c @@ -119,6 +119,8 @@ int buffer_feed(struct buffer *buf, const char *str, int len) if (buf->l >= buf->max_len) buf->flags |= BF_FULL; + /* notify that some data was read from the SI into the buffer */ + buf->flags |= BF_READ_PARTIAL; return -1; }