From fb0e9209a905e4e4fe1b913bd0d912066fcc3a2c Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 23 Sep 2009 23:47:55 +0200 Subject: [PATCH] [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. --- include/proto/buffers.h | 3 +++ src/buffers.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/include/proto/buffers.h b/include/proto/buffers.h index 432146c92..ab47b4f7c 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 a21eb4f33..dd5c00339 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; }