From: Willy Tarreau Date: Sat, 15 Dec 2018 23:35:15 +0000 (+0100) Subject: BUG/MEDIUM: htx/cache: use the correct class of error codes on abort X-Git-Tag: v1.9-dev11~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=273e964f6e5d5f62f7e556a61b153d4f739394f0;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: htx/cache: use the correct class of error codes on abort The HTX-specific cache code uses HTX_CACHE_* states which overlap with the legacy HTTP states. A typo in the error handling made the state become HTTP_CACHE_END, which equals 3 and is the value for HTX_CACHE_EOD, which explains why we were seeing a transition to trailers and memory corruption. no backport needed. --- diff --git a/src/cache.c b/src/cache.c index 0d67840adc..c3d44f5db6 100644 --- a/src/cache.c +++ b/src/cache.c @@ -962,7 +962,7 @@ static void htx_cache_io_handler(struct appctx *appctx) } if (res->flags & (CF_SHUTW|CF_SHUTW_NOW)) - appctx->st0 = HTTP_CACHE_END; + appctx->st0 = HTX_CACHE_END; if (appctx->st0 == HTX_CACHE_INIT) { appctx->ctx.cache.next = block_ptr(cache_ptr);