]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: cache: bad computation of the remaining size
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 28 Nov 2017 10:33:02 +0000 (11:33 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 28 Nov 2017 11:06:06 +0000 (12:06 +0100)
The cache was not setting the hdrs_len to zero when we are called
in the http_forward_data with headers + body.

The consequence is to always try to store a size - the size of headers,
during the calls to http_forward_data even when it has already forwarded
the headers.

Thanks to Cyril Bonté for reporting this bug.

Must be backported to 1.8.

src/cache.c

index 06d7ce8813ea9164dcc43cc7e66a9d5dc3cece65..cdfd43d570ff069cfacebd6c8d3ec34ba19e61e2 100644 (file)
@@ -228,6 +228,7 @@ cache_store_http_forward_data(struct stream *s, struct filter *filter,
                                                            MIN(bi_contig_data(msg->chn->buf), len - st->hdrs_len));
                                /* Rewind the buffer to forward all data */
                                b_rew(msg->chn->buf, st->hdrs_len);
+                               st->hdrs_len = 0;
                                if (ret)
                                        goto disable_cache;
                        }