]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] ensure that buffer_feed() and buffer_skip() set BF_*_PARTIAL
authorWilly Tarreau <w@1wt.eu>
Wed, 23 Sep 2009 21:47:55 +0000 (23:47 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Sep 2009 21:50:57 +0000 (23:50 +0200)
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.

include/proto/buffers.h
src/buffers.c

index 432146c92cb6031d493489eb550dccebc066c2a7..ab47b4f7cbbb0877d977feacd5e1878dd78346cc 100644 (file)
@@ -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;
 }
 
 /*
index a21eb4f33eaacb6d0dc28fb152e7ba3e63c566f7..dd5c00339e97b0eeda2c37233402113b04ccb1f0 100644 (file)
@@ -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;
 }