]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: channel: initialize xfer_small/xfer_large on new buffers
authorWilly Tarreau <w@1wt.eu>
Sun, 9 Feb 2014 07:31:49 +0000 (08:31 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 12 Feb 2014 10:45:45 +0000 (11:45 +0100)
These ones are only reset during transfers. There is a low but non-null
risk that a first full read causes the previous value to be reused and
immediately to immediately set the CF_STREAMER flag. The impact is only
to increase earlier than expected the SSL record size and to use splice().

This bug was already present in 1.4, so a backport is possible.

include/proto/channel.h

index 49a68b26bb4d815f6c776be7f94e2d64c0a69599..0afdc6588b66be0e276aa27ea413b64d47ce0570 100644 (file)
@@ -55,6 +55,7 @@ static inline void channel_init(struct channel *chn)
        chn->buf->i = 0;
        chn->buf->p = chn->buf->data;
        chn->to_forward = 0;
+       chn->xfer_small = chn->xfer_large = 0;
        chn->total = 0;
        chn->pipe = NULL;
        chn->analysers = 0;