r5073 - in trunk/varnish-cache/bin: varnishd varnishtest/tests
phk at varnish-cache.org
phk at varnish-cache.org
Mon Aug 9 08:22:27 CEST 2010
Author: phk
Date: 2010-08-09 08:22:27 +0200 (Mon, 09 Aug 2010)
New Revision: 5073
Added:
trunk/varnish-cache/bin/varnishtest/tests/r00742.vtc
Modified:
trunk/varnish-cache/bin/varnishd/mgt_vcc.c
trunk/varnish-cache/bin/varnishd/varnishd.c
Log:
Don't explode in vcl.show if VCL code contains a '%' sign.
Fixes: 742
Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2010-08-09 06:10:17 UTC (rev 5072)
+++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c 2010-08-09 06:22:27 UTC (rev 5073)
@@ -671,6 +671,8 @@
/*
* XXX: This should take an option argument to show all (include) files
+ * XXX: This violates the principle of not loading VCL's in the master
+ * XXX: process.
*/
void
mcf_config_show(struct cli *cli, const char * const *av, void *priv)
@@ -692,7 +694,7 @@
AZ(dlclose(dlh));
} else {
src = sym;
- cli_out(cli, src[0]);
+ cli_out(cli, "%s", src[0]);
/* cli_out(cli, src[1]); */
AZ(dlclose(dlh));
}
Modified: trunk/varnish-cache/bin/varnishd/varnishd.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/varnishd.c 2010-08-09 06:10:17 UTC (rev 5072)
+++ trunk/varnish-cache/bin/varnishd/varnishd.c 2010-08-09 06:22:27 UTC (rev 5073)
@@ -493,6 +493,7 @@
MCF_ParamSet(cli, "user", optarg);
break;
case 'V':
+ /* XXX: we should print the ident here */
varnish_version("varnishd");
exit(0);
case 'x':
Added: trunk/varnish-cache/bin/varnishtest/tests/r00742.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/r00742.vtc (rev 0)
+++ trunk/varnish-cache/bin/varnishtest/tests/r00742.vtc 2010-08-09 06:22:27 UTC (rev 5073)
@@ -0,0 +1,24 @@
+# $Id#
+
+test "% escapes in VCL source and vcl.show"
+
+server s1 {
+ rxreq
+ txresp
+} -start
+
+varnish v1 -vcl+backend {
+ C{
+ void foo(void)
+ {
+ printf("%s %s %s", "foo", "bar", "barf");
+ }
+ }C
+} -start
+
+client c1 {
+ txreq
+ rxresp
+} -run
+
+varnish v1 -cliok "vcl.show vcl1"
More information about the varnish-commit
mailing list