From efef3237834e9e855d25dcead8f7dae66ac3084f Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sun, 16 Dec 2018 00:37:45 +0100 Subject: [PATCH] BUG/MINOR: cache: also consider CF_SHUTR to abort delivery The cache runs in an applet, so it delivers data into the input side of the channel's buffer. Thus it must also abort feeding the buffer as soon as CF_SHUTR is present, not just CF_SHUTW*, since these last ones may only appear later. There doesn't seem to be an observable side effect of this bug, the fix probably doesn't even need to be backported. --- src/cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cache.c b/src/cache.c index c3d44f5db6..0322552241 100644 --- a/src/cache.c +++ b/src/cache.c @@ -961,7 +961,7 @@ static void htx_cache_io_handler(struct appctx *appctx) goto out; } - if (res->flags & (CF_SHUTW|CF_SHUTW_NOW)) + if (res->flags & (CF_SHUTW|CF_SHUTR|CF_SHUTW_NOW)) appctx->st0 = HTX_CACHE_END; if (appctx->st0 == HTX_CACHE_INIT) { @@ -1190,7 +1190,7 @@ static void http_cache_io_handler(struct appctx *appctx) goto out; } - if (res->flags & (CF_SHUTW|CF_SHUTW_NOW)) + if (res->flags & (CF_SHUTW|CF_SHUTW_NOW|CF_SHUTR)) appctx->st0 = HTTP_CACHE_END; /* buffer are aligned there, should be fine */