[4.1] d5044f5 Only update the active_vcl on successful VCL compiles

PÃ¥l Hermunn Johansen hermunn at varnish-software.com
Tue Sep 13 13:07:11 CEST 2016


commit d5044f53e98e64624288b8e7ac143409014f8d5e
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Sep 12 09:12:41 2016 +0000

    Only update the active_vcl on successful VCL compiles

diff --git a/bin/varnishd/mgt/mgt_vcl.c b/bin/varnishd/mgt/mgt_vcl.c
index 21f84f7..3801863 100644
--- a/bin/varnishd/mgt/mgt_vcl.c
+++ b/bin/varnishd/mgt/mgt_vcl.c
@@ -82,8 +82,6 @@ mgt_vcl_add(const char *name, const char *libfile, const char *state)
 
 	bprintf(vp->state, "%s", state);
 
-	if (active_vcl == NULL)
-		active_vcl = vp;
 	VTAILQ_INSERT_TAIL(&vclhead, vp, list);
 	return (vp);
 }
@@ -210,6 +208,9 @@ mgt_new_vcl(struct cli *cli, const char *vclname, const char *vclsrc,
 	vp = mgt_vcl_add(vclname, lib, state);
 	free(lib);
 
+	if (active_vcl == NULL)
+		active_vcl = vp;
+
 	if (child_pid < 0)
 		return;
 



More information about the varnish-commit mailing list