[master] 2b623ea Add a parameter to disable inline-C code in VCL
Poul-Henning Kamp
phk at varnish-cache.org
Sat Apr 28 18:41:39 CEST 2012
commit 2b623eafd3de8f9dfdc814c30d264e9dc9090e33
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Sat Apr 28 15:06:14 2012 +0000
Add a parameter to disable inline-C code in VCL
diff --git a/bin/varnishd/mgt/mgt.h b/bin/varnishd/mgt/mgt.h
index c319e57..0ad01de 100644
--- a/bin/varnishd/mgt/mgt.h
+++ b/bin/varnishd/mgt/mgt.h
@@ -105,6 +105,7 @@ extern char *mgt_cc_cmd;
extern const char *mgt_vcl_dir;
extern const char *mgt_vmod_dir;
extern unsigned mgt_vcc_err_unref;
+extern unsigned mgt_vcc_allow_inline_c;
#define REPORT0(pri, fmt) \
do { \
diff --git a/bin/varnishd/mgt/mgt_param.c b/bin/varnishd/mgt/mgt_param.c
index e79b7e9..b72b0df 100644
--- a/bin/varnishd/mgt/mgt_param.c
+++ b/bin/varnishd/mgt/mgt_param.c
@@ -1177,11 +1177,17 @@ static const struct parspec input_parspec[] = {
".",
#endif
NULL },
+
{ "vcc_err_unref", tweak_bool, &mgt_vcc_err_unref, 0, 0,
"Unreferenced VCL objects result in error.\n",
0,
"on", "bool" },
+ { "vcc_allow_inline_c", tweak_bool, &mgt_vcc_allow_inline_c, 0, 0,
+ "Allow inline C code in VCL.\n",
+ 0,
+ "on", "bool" },
+
{ "pcre_match_limit", tweak_uint,
&mgt_param.vre_limits.match,
diff --git a/bin/varnishd/mgt/mgt_vcc.c b/bin/varnishd/mgt/mgt_vcc.c
index e419261..269a453 100644
--- a/bin/varnishd/mgt/mgt_vcc.c
+++ b/bin/varnishd/mgt/mgt_vcc.c
@@ -63,6 +63,7 @@ char *mgt_cc_cmd;
const char *mgt_vcl_dir;
const char *mgt_vmod_dir;
unsigned mgt_vcc_err_unref;
+unsigned mgt_vcc_allow_inline_c;
static struct vcc *vcc;
@@ -139,6 +140,7 @@ run_vcc(void *priv)
VCC_VCL_dir(vcc, mgt_vcl_dir);
VCC_VMOD_dir(vcc, mgt_vmod_dir);
VCC_Err_Unref(vcc, mgt_vcc_err_unref);
+ VCC_Allow_InlineC(vcc, mgt_vcc_allow_inline_c);
csrc = VCC_Compile(vcc, sb, vp->vcl);
AZ(VSB_finish(sb));
if (VSB_len(sb))
More information about the varnish-commit
mailing list