]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: cache: also consider CF_SHUTR to abort delivery
authorWilly Tarreau <w@1wt.eu>
Sat, 15 Dec 2018 23:37:45 +0000 (00:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 15 Dec 2018 23:40:31 +0000 (00:40 +0100)
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

index c3d44f5db6ede30aa5dea7b12aa5c09f20f4bcfd..0322552241028d82a74507de17bd1e75c417721e 100644 (file)
@@ -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 */