From: Willy Tarreau Date: Thu, 31 May 2012 14:37:11 +0000 (+0200) Subject: BUG/MEDIUM: buffers: fix bi_putchr() to correctly advance the pointer X-Git-Tag: v1.5-dev12~161 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=743a2d3e14a1fade71b34121f2f599ebfaee8109;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: buffers: fix bi_putchr() to correctly advance the pointer bi_putchr() failed to move the buffer pointer forward. The only user was the peer handler which was broken, it failed to sync. Thanks to Hervé Commowick for reporting the issue. --- diff --git a/src/buffers.c b/src/buffers.c index 7becb4863d..6eeb64f548 100644 --- a/src/buffers.c +++ b/src/buffers.c @@ -154,9 +154,7 @@ int bi_putchr(struct buffer *buf, char c) if (buf->to_forward >= 1) { if (buf->to_forward != BUF_INFINITE_FORWARD) buf->to_forward--; - buf->o++; - buf->i--; - buf->flags &= ~BF_OUT_EMPTY; + b_adv(buf, 1); } buf->total++;