[master] 391d472 Have VCC report VMODs to Varnishd out of band (like VCL dependencies).
Poul-Henning Kamp
phk at FreeBSD.org
Sun Mar 5 00:55:05 CET 2017
commit 391d4720ce7fc39999ff0b292bc00a14c74795c5
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Sat Mar 4 22:32:52 2017 +0000
Have VCC report VMODs to Varnishd out of band (like VCL dependencies).
diff --git a/bin/varnishd/mgt/mgt_vcc.c b/bin/varnishd/mgt/mgt_vcc.c
index 087078a..bfb8b6f 100644
--- a/bin/varnishd/mgt/mgt_vcc.c
+++ b/bin/varnishd/mgt/mgt_vcc.c
@@ -373,8 +373,10 @@ mgt_VccCompile(struct cli *cli, struct vclprog *vcl, const char *vclname,
AZ(av[0]);
AZ(strcmp(av[1], "/*"));
AZ(strcmp(av[ac-1], "*/"));
- AZ(strcmp(av[3], "VCL"));
- mgt_vcl_depends(vcl, av[4]);
+ if (!strcmp(av[3], "VCL"))
+ mgt_vcl_depends(vcl, av[4]);
+ else if (strcmp(av[3], "VMOD"))
+ WRONG("Wrong VCCINFO");
VAV_Free(av);
}
AZ(fclose(fcs));
diff --git a/lib/libvcc/vcc_vmod.c b/lib/libvcc/vcc_vmod.c
index c6e08c1..b378ccf 100644
--- a/lib/libvcc/vcc_vmod.c
+++ b/lib/libvcc/vcc_vmod.c
@@ -37,6 +37,7 @@
#include "vcs_version.h"
+#include "libvcc.h"
#include "vfil.h"
#include "vmod_abi.h"
#include "vrt.h"
@@ -212,6 +213,9 @@ vcc_ParseImport(struct vcc *tl)
VSB_printf(ifp->ini, "\t ))\n");
VSB_printf(ifp->ini, "\t\treturn(1);");
+ VSB_printf(tl->fi, "%s VMOD %s ./vmod_cache/_vmod_%.*s.%s */\n",
+ VCC_INFO_PREFIX, fnp, PF(mod), vmd->file_id);
+
/* XXX: zero the function pointer structure ?*/
VSB_printf(ifp->fin, "\t\tVRT_priv_fini(&vmod_priv_%.*s);\n", PF(mod));
VSB_printf(ifp->fin, "\t\t\tVRT_Vmod_Fini(&VGC_vmod_%.*s);", PF(mod));
More information about the varnish-commit
mailing list