[master] 0577bac0a Assert that if a connection is closed before being used, it is so for a reason

Nils Goroll nils.goroll at uplex.de
Tue Oct 26 13:40:08 UTC 2021


commit 0577bac0a1ef9247bffcd9c923b35367a5bb5b17
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Aug 16 16:08:14 2021 +0200

    Assert that if a connection is closed before being used, it is so for a reason
    
    ... but we can not make any assumption as to why
    
    Fixes #3664

diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c
index 829b56595..063048931 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -233,15 +233,8 @@ vbe_dir_finish(VRT_CTX, VCL_BACKEND d)
 	CHECK_OBJ_NOTNULL(bo->htc, HTTP_CONN_MAGIC);
 	pfd = bo->htc->priv;
 	bo->htc->priv = NULL;
-	if (PFD_State(pfd) != PFD_STATE_USED) {
+	if (PFD_State(pfd) != PFD_STATE_USED)
 		AN(bo->htc->doclose);
-		if (bo->htc->doclose != SC_TX_PIPE) {
-#define SESS_CLOSE(U, l, err, desc)				\
-			if (bo->htc->doclose == SC_ ## U)	\
-				AN(err);
-#include "tbl/sess_close.h"
-		}
-	}
 	if (bo->htc->doclose != SC_NULL || bp->proxy_header != 0) {
 		VSLb(bo->vsl, SLT_BackendClose, "%d %s close", *PFD_Fd(pfd),
 		    VRT_BACKEND_string(d));


More information about the varnish-commit mailing list