From: William Lallemand Date: Tue, 28 Nov 2017 10:33:02 +0000 (+0100) Subject: BUG/MEDIUM: cache: bad computation of the remaining size X-Git-Tag: v1.9-dev1~646 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bcd9101a6652856d2db30b254906a2c5eb1bb20a;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: cache: bad computation of the remaining size 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. --- diff --git a/src/cache.c b/src/cache.c index 06d7ce8813..cdfd43d570 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; }