[master] 5e06e03 Drop VTP_Wait call in vbe_dir_finish

Dag Haavi Finstad daghf at varnish-software.com
Mon Nov 27 11:51:07 UTC 2017


commit 5e06e03bcf50026fad4d7ee8ae4efd6076e22e7a
Author: Dag Haavi Finstad <daghf at varnish-software.com>
Date:   Fri Nov 24 16:13:08 2017 +0100

    Drop VTP_Wait call in vbe_dir_finish
    
    With VTP_Close now being capable of dealing with STOLEN connections, we
    no longer need to VTP_Wait for them prior to close.

diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c
index c5f9127..5f5ebb5 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -178,13 +178,15 @@ vbe_dir_finish(const struct director *d, struct worker *wrk,
 	CAST_OBJ_NOTNULL(vtp, bo->htc->priv, VTP_MAGIC);
 	bo->htc->priv = NULL;
 	if (vtp->state != VTP_STATE_USED)
-		VTP_Wait(wrk, vtp);
+		assert(bo->htc->doclose == SC_TX_PIPE);
 	if (bo->htc->doclose != SC_NULL || bp->proxy_header != 0) {
 		VSLb(bo->vsl, SLT_BackendClose, "%d %s", vtp->fd,
 		    bp->director->display_name);
 		VTP_Close(&vtp);
+		AZ(vtp);
 		Lck_Lock(&bp->mtx);
 	} else {
+		assert (vtp->state == VTP_STATE_USED);
 		VSLb(bo->vsl, SLT_BackendReuse, "%d %s", vtp->fd,
 		    bp->director->display_name);
 		Lck_Lock(&bp->mtx);


More information about the varnish-commit mailing list