[4.1] 0fe9fb9 Clarifying comments, and move a function call to a more natural location.

Poul-Henning Kamp phk at FreeBSD.org
Fri Sep 4 15:54:49 CEST 2015


commit 0fe9fb938a8bfb54f7814f91cb2e74d2176d8862
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Jul 7 20:41:40 2015 +0000

    Clarifying comments, and move a function call to a more natural location.

diff --git a/bin/varnishd/cache/cache_backend_cfg.c b/bin/varnishd/cache/cache_backend_cfg.c
index e7301ac..b05acea 100644
--- a/bin/varnishd/cache/cache_backend_cfg.c
+++ b/bin/varnishd/cache/cache_backend_cfg.c
@@ -51,7 +51,7 @@ static VTAILQ_HEAD(, backend) backends = VTAILQ_HEAD_INITIALIZER(backends);
 static struct lock backends_mtx;
 
 /*--------------------------------------------------------------------
- * Create/Delete a new director::backend instance.
+ * Create a new static or dynamic director::backend instance.
  */
 
 struct director *
@@ -117,6 +117,11 @@ VRT_new_backend(VRT_CTX, const struct vrt_backend *vrt)
 	return (b->director);
 }
 
+/*--------------------------------------------------------------------
+ * Delete a dynamic director::backend instance.  Undeleted dynamic and
+ * static instances are GC'ed when the VCL is discarded (in cache_vcl.c)
+ */
+
 void
 VRT_delete_backend(VRT_CTX, struct director **dp)
 {
@@ -130,6 +135,7 @@ VRT_delete_backend(VRT_CTX, struct director **dp)
 	CHECK_OBJ_NOTNULL(d, DIRECTOR_MAGIC);
 	CAST_OBJ_NOTNULL(be, d->priv, BACKEND_MAGIC);
 	VCL_DelBackend(ctx->vcl, be);
+	VBE_Delete(be);
 }
 
 /*---------------------------------------------------------------------
diff --git a/bin/varnishd/cache/cache_vcl.c b/bin/varnishd/cache/cache_vcl.c
index 7d87cb0..3ab89ff 100644
--- a/bin/varnishd/cache/cache_vcl.c
+++ b/bin/varnishd/cache/cache_vcl.c
@@ -210,7 +210,6 @@ VCL_DelBackend(struct vcl *vcl, struct backend *be)
 	Lck_Lock(&vcl_mtx);
 	VTAILQ_REMOVE(&vcl->backend_list, be, vcl_list);
 	Lck_Unlock(&vcl_mtx);
-	VBE_Delete(be);
 }
 
 static void



More information about the varnish-commit mailing list