[4.1] c36ed16 Drop VBT_Wait call in vbe_dir_finish

Dag Haavi Finstad daghf at varnish-software.com
Mon Nov 27 16:36:10 UTC 2017

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

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

diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c
index bc5a244..491259c 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -152,13 +152,15 @@ vbe_dir_finish(const struct director *d, struct worker *wrk,
 	CAST_OBJ_NOTNULL(vbc, bo->htc->priv, VBC_MAGIC);
 	bo->htc->priv = NULL;
 	if (vbc->state != VBC_STATE_USED)
-		VBT_Wait(wrk, vbc);
+		assert(bo->htc->doclose == SC_TX_PIPE);
 	if (bo->htc->doclose != SC_NULL) {
 		VSLb(bo->vsl, SLT_BackendClose, "%d %s", vbc->fd,
 		VBT_Close(bp->tcp_pool, &vbc);
+		AZ(vbc);
 	} else {
+		assert (vbc->state == VBC_STATE_USED);
 		VSLb(bo->vsl, SLT_BackendReuse, "%d %s", vbc->fd,

More information about the varnish-commit mailing list