]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: buffer: replace buffer_flush() with c_adv(chn, ci_data(chn))
authorWilly Tarreau <w@1wt.eu>
Fri, 15 Jun 2018 13:16:51 +0000 (15:16 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 19 Jul 2018 14:23:41 +0000 (16:23 +0200)
It used to forward some input into output.

include/common/buffer.h
src/stream.c

index 18b5aa4ae97c13123e5b28e9a89f8f6089d11e47..dde0fcc63f3f6f2d04a6d2cd300ea3adc5104ffd 100644 (file)
@@ -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 <str> at position <pos> which must be in
  * buffer <b>, and moves <end> just after the end of <str>. <b>'s parameters
  * (l, r, lr) are updated to be valid after the shift. the shift value
index e958423b50e11ac20d9249b69e745fccba774883..d6e28646322e717a7ff2aa614c2d0404014cbd80 100644 (file)
@@ -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.