From bcd9101a6652856d2db30b254906a2c5eb1bb20a Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Tue, 28 Nov 2017 11:33:02 +0100 Subject: [PATCH] BUG/MEDIUM: cache: bad computation of the remaining size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cache.c b/src/cache.c index 06d7ce881..cdfd43d57 100644 --- a/src/cache.c +++ b/src/cache.c @@ -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; }