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.
This commit is contained in:
William Lallemand 2017-11-28 11:33:02 +01:00 committed by Willy Tarreau
parent c3cd35f96c
commit bcd9101a66

View 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;
}