Commit 2b623eaf authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add a parameter to disable inline-C code in VCL

parent 0b008770
...@@ -105,6 +105,7 @@ extern char *mgt_cc_cmd; ...@@ -105,6 +105,7 @@ extern char *mgt_cc_cmd;
extern const char *mgt_vcl_dir; extern const char *mgt_vcl_dir;
extern const char *mgt_vmod_dir; extern const char *mgt_vmod_dir;
extern unsigned mgt_vcc_err_unref; extern unsigned mgt_vcc_err_unref;
extern unsigned mgt_vcc_allow_inline_c;
#define REPORT0(pri, fmt) \ #define REPORT0(pri, fmt) \
do { \ do { \
......
...@@ -1177,11 +1177,17 @@ static const struct parspec input_parspec[] = { ...@@ -1177,11 +1177,17 @@ static const struct parspec input_parspec[] = {
".", ".",
#endif #endif
NULL }, NULL },
{ "vcc_err_unref", tweak_bool, &mgt_vcc_err_unref, 0, 0, { "vcc_err_unref", tweak_bool, &mgt_vcc_err_unref, 0, 0,
"Unreferenced VCL objects result in error.\n", "Unreferenced VCL objects result in error.\n",
0, 0,
"on", "bool" }, "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, { "pcre_match_limit", tweak_uint,
&mgt_param.vre_limits.match, &mgt_param.vre_limits.match,
......
...@@ -63,6 +63,7 @@ char *mgt_cc_cmd; ...@@ -63,6 +63,7 @@ char *mgt_cc_cmd;
const char *mgt_vcl_dir; const char *mgt_vcl_dir;
const char *mgt_vmod_dir; const char *mgt_vmod_dir;
unsigned mgt_vcc_err_unref; unsigned mgt_vcc_err_unref;
unsigned mgt_vcc_allow_inline_c;
static struct vcc *vcc; static struct vcc *vcc;
...@@ -139,6 +140,7 @@ run_vcc(void *priv) ...@@ -139,6 +140,7 @@ run_vcc(void *priv)
VCC_VCL_dir(vcc, mgt_vcl_dir); VCC_VCL_dir(vcc, mgt_vcl_dir);
VCC_VMOD_dir(vcc, mgt_vmod_dir); VCC_VMOD_dir(vcc, mgt_vmod_dir);
VCC_Err_Unref(vcc, mgt_vcc_err_unref); VCC_Err_Unref(vcc, mgt_vcc_err_unref);
VCC_Allow_InlineC(vcc, mgt_vcc_allow_inline_c);
csrc = VCC_Compile(vcc, sb, vp->vcl); csrc = VCC_Compile(vcc, sb, vp->vcl);
AZ(VSB_finish(sb)); AZ(VSB_finish(sb));
if (VSB_len(sb)) if (VSB_len(sb))
......
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