r4990 - trunk/varnish-cache/bin/varnishd
phk at varnish-cache.org
phk at varnish-cache.org
Tue Jun 29 12:01:59 CEST 2010
Author: phk
Date: 2010-06-29 12:01:59 +0200 (Tue, 29 Jun 2010)
New Revision: 4990
Modified:
trunk/varnish-cache/bin/varnishd/mgt.h
trunk/varnish-cache/bin/varnishd/mgt_param.c
trunk/varnish-cache/bin/varnishd/mgt_vcc.c
Log:
Add a vcl_dir parameter to resolve relative VCL pathnames from
(vcl.load/include)
Does not do anything yet.
Modified: trunk/varnish-cache/bin/varnishd/mgt.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt.h 2010-06-28 14:28:36 UTC (rev 4989)
+++ trunk/varnish-cache/bin/varnishd/mgt.h 2010-06-29 10:01:59 UTC (rev 4990)
@@ -80,6 +80,7 @@
int mgt_push_vcls_and_start(unsigned *status, char **p);
int mgt_has_vcl(void);
extern char *mgt_cc_cmd;
+extern char *mgt_vcl_dir;
#define REPORT0(pri, fmt) \
Modified: trunk/varnish-cache/bin/varnishd/mgt_param.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_param.c 2010-06-28 14:28:36 UTC (rev 4989)
+++ trunk/varnish-cache/bin/varnishd/mgt_param.c 2010-06-29 10:01:59 UTC (rev 4990)
@@ -429,17 +429,16 @@
/*--------------------------------------------------------------------*/
static void
-tweak_cc_command(struct cli *cli, const struct parspec *par, const char *arg)
+tweak_string(struct cli *cli, const struct parspec *par, const char *arg)
{
+ char **p = TRUST_ME(par->priv);
+ AN(p);
/* XXX should have tweak_generic_string */
- (void)par;
if (arg == NULL) {
- cli_quote(cli, mgt_cc_cmd);
+ cli_quote(cli, *p);
} else {
- free(mgt_cc_cmd);
- mgt_cc_cmd = strdup(arg);
- XXXAN(mgt_cc_cmd);
+ REPLACE(*p, arg);
}
}
@@ -629,14 +628,13 @@
"operations necessary for LRU list access.",
EXPERIMENTAL,
"2", "seconds" },
- { "cc_command", tweak_cc_command, NULL, 0, 0,
+ { "cc_command", tweak_string, &mgt_cc_cmd, 0, 0,
"Command used for compiling the C source code to a "
"dlopen(3) loadable object. Any occurrence of %s in "
"the string will be replaced with the source file name, "
"and %o will be replaced with the output file name.",
MUST_RELOAD,
- VCC_CC
- , NULL },
+ VCC_CC , NULL },
{ "max_restarts", tweak_uint, &master.max_restarts, 0, UINT_MAX,
"Upper limit on how many times a request can restart."
"\nBe aware that restarts are likely to cause a hit against "
@@ -824,6 +822,11 @@
"A value of zero disables the ban lurker.",
EXPERIMENTAL,
"180.0", "s" },
+ { "vcl_dir", tweak_string, &mgt_vcl_dir, 0, 0,
+ "Directory from which relative VCL filenames (vcl.load and "
+ "include) are opened.",
+ 0,
+ ".", NULL },
{ NULL, NULL, NULL }
};
Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2010-06-28 14:28:36 UTC (rev 4989)
+++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2010-06-29 10:01:59 UTC (rev 4990)
@@ -67,6 +67,7 @@
static VTAILQ_HEAD(, vclprog) vclhead = VTAILQ_HEAD_INITIALIZER(vclhead);
char *mgt_cc_cmd;
+char *mgt_vcl_dir;
/*--------------------------------------------------------------------*/
More information about the varnish-commit
mailing list