]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: htx/cache: use the correct class of error codes on abort
authorWilly Tarreau <w@1wt.eu>
Sat, 15 Dec 2018 23:35:15 +0000 (00:35 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 15 Dec 2018 23:40:30 +0000 (00:40 +0100)
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.

src/cache.c

index 0d67840adc6220c8e1c6849cbdbb02c3f4f9ddb2..c3d44f5db6ede30aa5dea7b12aa5c09f20f4bcfd 100644 (file)
@@ -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);