[master] 968fc3e Call the vcl_fini{} from the VGC's event(DISCARD).

Poul-Henning Kamp phk at FreeBSD.org
Mon Jun 15 12:40:05 CEST 2015


commit 968fc3ecf4293b27c195bbb6e9d0605c9195973c
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Jun 15 10:39:06 2015 +0000

    Call the vcl_fini{} from the VGC's event(DISCARD).

diff --git a/bin/varnishd/cache/cache_vcl.c b/bin/varnishd/cache/cache_vcl.c
index ff25f62..2a98fd8 100644
--- a/bin/varnishd/cache/cache_vcl.c
+++ b/bin/varnishd/cache/cache_vcl.c
@@ -290,8 +290,6 @@ VCL_Nuke(struct vcls *vcl)
 	ctx.method = VCL_MET_FINI;
 	ctx.handling = &hand;
 	ctx.vcl = vcl->conf;
-	(void)vcl->conf->fini_func(&ctx);
-	assert(hand == VCL_RET_OK);
 	AZ(vcl->conf->event_vcl(&ctx, VCL_EVENT_DISCARD));
 	free(vcl->conf->loaded_name);
 	(void)dlclose(vcl->dlh);
diff --git a/lib/libvcc/vcc_compile.c b/lib/libvcc/vcc_compile.c
index 24ca4df..21fc395 100644
--- a/lib/libvcc/vcc_compile.c
+++ b/lib/libvcc/vcc_compile.c
@@ -334,6 +334,7 @@ EmitInitFini(const struct vcc *tl)
 	 */
 	Fc(tl, 0, "\nstatic int\nVGC_Discard(VRT_CTX)\n{\n\n");
 
+	Fc(tl, 0, "\t(void)VGC_function_vcl_fini(ctx);\n\n");
 	VTAILQ_FOREACH_REVERSE(p, &tl->inifin, inifinhead, list) {
 		AZ(VSB_finish(p->fin));
 		if (VSB_len(p->fin)) {



More information about the varnish-commit mailing list