[master] 4c86d54f5 Get the probe's VTP reference in the probe code

Nils Goroll nils.goroll at uplex.de
Thu Jun 28 12:29:07 UTC 2018


commit 4c86d54f5e5be4bd19ae279057c53bf043757a98
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Thu Jun 28 14:27:28 2018 +0200

    Get the probe's VTP reference in the probe code
    
    ... not in the caller

diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c
index 4f542f548..f50928cb2 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -550,10 +550,8 @@ VRT_new_backend_clustered(VRT_CTX, struct vsmw_cluster *vc,
 	    vrt->path, vbe_proto_ident);
 	Lck_Unlock(&backends_mtx);
 
-	if (vbp != NULL) {
-		VTP_AddRef(be->tcp_pool);
+	if (vbp != NULL)
 		VBP_Insert(be, vbp, be->tcp_pool);
-	}
 
 	return (be->director);
 }
diff --git a/bin/varnishd/cache/cache_backend_probe.c b/bin/varnishd/cache/cache_backend_probe.c
index a5e67c021..d8337216b 100644
--- a/bin/varnishd/cache/cache_backend_probe.c
+++ b/bin/varnishd/cache/cache_backend_probe.c
@@ -663,6 +663,7 @@ VBP_Insert(struct backend *b, const struct vrt_backend_probe *vp,
 	XXXAN(vt);
 
 	vt->tcp_pool = tp;
+	VTP_AddRef(vt->tcp_pool);
 	vt->backend = b;
 	b->probe = vt;
 


More information about the varnish-commit mailing list