[experimental-ims] 3ad76c3 Mark synthetic as only available in vcl_error

Geoff Simmons geoff at varnish-cache.org
Sun Jun 19 18:04:57 CEST 2011


commit 3ad76c3b3566dc19f392a70a27d68417c6d756e0
Author: Tollef Fog Heen <tfheen at varnish-software.com>
Date:   Thu Jun 9 09:05:41 2011 +0200

    Mark synthetic as only available in vcl_error
    
    Eventually, we want to be able to do synthetic everywhere, but for
    now, mark it as just available in vcl_error.
    
    Fixes: #936

diff --git a/bin/varnishtest/tests/r00936.vtc b/bin/varnishtest/tests/r00936.vtc
new file mode 100644
index 0000000..544245a
--- /dev/null
+++ b/bin/varnishtest/tests/r00936.vtc
@@ -0,0 +1,15 @@
+varnishtest "synthetic is only allowed in error"
+
+server s1 {
+	rxreq
+	txresp
+} -start
+
+varnish v1 -badvcl {
+	backend foo { .host = "127.0.0.1"; }
+
+	sub vcl_recv {
+		synthetic "HELLOO"; return (error);
+	}
+}
+
diff --git a/lib/libvcl/vcc_action.c b/lib/libvcl/vcc_action.c
index 801360a..0600fd0 100644
--- a/lib/libvcl/vcc_action.c
+++ b/lib/libvcl/vcc_action.c
@@ -342,7 +342,7 @@ static struct action_table {
 	{ "return",		parse_return },
 	{ "rollback",		parse_rollback },
 	{ "set",		parse_set },
-	{ "synthetic",		parse_synthetic },
+	{ "synthetic",		parse_synthetic, VCL_MET_ERROR },
 	{ "unset",		parse_unset },
 	{ "purge",		parse_purge, VCL_MET_MISS | VCL_MET_HIT },
 	{ NULL,			NULL }



More information about the varnish-commit mailing list