From: Willy Tarreau Date: Fri, 15 Jun 2018 13:16:51 +0000 (+0200) Subject: MINOR: buffer: replace buffer_flush() with c_adv(chn, ci_data(chn)) X-Git-Tag: v1.9-dev1~114 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=144c5c4d2190b651c8ab72520411aa7a028dd0f2;p=thirdparty%2Fhaproxy.git MINOR: buffer: replace buffer_flush() with c_adv(chn, ci_data(chn)) It used to forward some input into output. --- diff --git a/include/common/buffer.h b/include/common/buffer.h index 18b5aa4ae9..dde0fcc63f 100644 --- a/include/common/buffer.h +++ b/include/common/buffer.h @@ -124,17 +124,6 @@ static inline void bi_fast_delete(struct buffer *buf, int n) buf->p += n; } -/* Schedule all remaining buffer data to be sent. ->o is not touched if it - * already covers those data. That permits doing a flush even after a forward, - * although not recommended. - */ -static inline void buffer_flush(struct buffer *buf) -{ - buf->p = buffer_wrap_add(buf, buf->p + buf->i); - buf->o += buf->i; - buf->i = 0; -} - /* This function writes the string at position which must be in * buffer , and moves just after the end of . 's parameters * (l, r, lr) are updated to be valid after the shift. the shift value diff --git a/src/stream.c b/src/stream.c index e958423b50..d6e2864632 100644 --- a/src/stream.c +++ b/src/stream.c @@ -2106,7 +2106,7 @@ struct task *process_stream(struct task *t, void *context, unsigned short state) channel_auto_read(req); channel_auto_connect(req); channel_auto_close(req); - buffer_flush(req->buf); + c_adv(req, ci_data(req)); /* We'll let data flow between the producer (if still connected) * to the consumer (which might possibly not be connected yet). @@ -2265,7 +2265,7 @@ struct task *process_stream(struct task *t, void *context, unsigned short state) */ channel_auto_read(res); channel_auto_close(res); - buffer_flush(res->buf); + c_adv(res, ci_data(res)); /* We'll let data flow between the producer (if still connected) * to the consumer.