From 74b41ba025c66bf4d4d2a5dfa320ea8376acb36e Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 4 Jan 2019 16:15:34 +0100 Subject: [PATCH] BUG/MINOR: cache/htx: Be sure to count partial trailers When a chunked object is served from the cache, If the trailers are not pushed in the channel's buffer in one time, we still have to count them in the total written bytes in the buffer. This patch must be backported to 1.9. --- src/cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cache.c b/src/cache.c index d80ee904f9..77e411f594 100644 --- a/src/cache.c +++ b/src/cache.c @@ -1027,12 +1027,12 @@ static void htx_cache_io_handler(struct appctx *appctx) unsigned int len = first->len - sizeof(*cache_ptr) - appctx->ctx.cache.sent; ret = htx_cache_dump_data(appctx, res_htx, HTX_BLK_TLR, len); + total += ret; if (ret < len) { si_rx_room_blk(si); goto out; } - total += ret; if (first->len == sizeof(*cache_ptr) + appctx->ctx.cache.sent) appctx->st0 = HTX_CACHE_EOM; } -- 2.47.3