Commit db97d8ea authored by Federico G. Schwindt's avatar Federico G. Schwindt Committed by Dridi Boukelmoune

Add a debug flag to keep VCL C and so files around

Enabled when using varnishtest -L.
parent b0249dc8
......@@ -380,7 +380,8 @@ mgt_VccCompile(struct cli *cli, struct vclprog *vcl, const char *vclname,
}
AZ(fclose(fcs));
(void)unlink(vp.csrcfile);
if (!MGT_DO_DEBUG(DBG_VCL_KEEP))
(void)unlink(vp.csrcfile);
free(vp.csrcfile);
free(vp.dir);
......
......@@ -265,7 +265,8 @@ mgt_vcl_del(struct vclprog *vp)
VTAILQ_REMOVE(&vclhead, vp, list);
if (vp->fname != NULL) {
AZ(unlink(vp->fname));
if (!MGT_DO_DEBUG(DBG_VCL_KEEP))
AZ(unlink(vp->fname));
p = strrchr(vp->fname, '/');
AN(p);
*p = '\0';
......
......@@ -413,8 +413,9 @@ varnish_launch(struct varnish *v)
if (vtc_witness)
VSB_cat(vsb, " -p debug=+witness");
if (leave_temp) {
VSB_cat(vsb, " -p debug=+vsm_keep");
VSB_cat(vsb, " -p debug=+vcl_keep");
VSB_cat(vsb, " -p debug=+vmod_so_keep");
VSB_cat(vsb, " -p debug=+vsm_keep");
}
VSB_printf(vsb, " -l 2m");
VSB_printf(vsb, " -p auto_restart=off");
......
......@@ -50,6 +50,7 @@ DEBUG_BIT(H2_NOCHECK, h2_nocheck, "Disable various H2 checks")
DEBUG_BIT(VMOD_SO_KEEP, vmod_so_keep, "Keep copied VMOD libraries")
DEBUG_BIT(PROCESSORS, processors, "Fetch/Deliver processors")
DEBUG_BIT(PROTOCOL, protocol, "Protocol debugging")
DEBUG_BIT(VCL_KEEP, vcl_keep, "Keep VCL C and so files")
#undef DEBUG_BIT
/*lint -restore */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment