[6.0] 7a5494896 Get the probe's VTP reference in the probe code

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Aug 16 08:53:16 UTC 2018


commit 7a54948963c1f486c0d377de0360de14e37f26dd
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 7408f05a4..6ad610f5d 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -525,10 +525,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);
-	}
 
 	be->vsc = VSC_vbe_New(vc, &be->vsc_seg,
 	    "%s.%s", VCL_Name(ctx->vcl), vrt->vcl_name);
diff --git a/bin/varnishd/cache/cache_backend_probe.c b/bin/varnishd/cache/cache_backend_probe.c
index ba1940838..0ae04956c 100644
--- a/bin/varnishd/cache/cache_backend_probe.c
+++ b/bin/varnishd/cache/cache_backend_probe.c
@@ -651,6 +651,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