[master] b211dd2 Retire rollback
Federico G. Schwindt
fgsch at lodoss.net
Tue Feb 23 10:42:38 CET 2016
commit b211dd2e2b8a0e2c469aa20a7665f5b2c9c18b6b
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date: Mon Feb 22 13:15:41 2016 +0000
Retire rollback
This has been available via the std module for some time now.
OK'd by phk at .
diff --git a/bin/varnishtest/tests/c00032.vtc b/bin/varnishtest/tests/c00032.vtc
deleted file mode 100644
index d5d06e3..0000000
--- a/bin/varnishtest/tests/c00032.vtc
+++ /dev/null
@@ -1,35 +0,0 @@
-varnishtest "Test Rollback"
-
-
-server s1 {
- rxreq
- expect req.url == "/foo"
- expect req.http.foobar == "harck-coff"
- txresp -status 400
- accept
- rxreq
- expect req.url == "/bar"
- expect req.http.foobar == "snark"
- txresp -bodylen 5
-} -start
-
-varnish v1 -vcl+backend {
- sub vcl_recv {
- if (req.url == "/foo") {
- set req.http.foobar = "harck-coff";
- }
- }
-
- sub vcl_deliver {
- if (resp.status == 400) {
- rollback;
- set req.url = "/bar";
- return (restart);
- }
- }
-} -start
-
-client c1 {
- txreq -url "/foo" -hdr "foobar: snark"
- rxresp
-} -run
diff --git a/bin/varnishtest/tests/r01168.vtc b/bin/varnishtest/tests/r01168.vtc
index e26b2ce..ece1c9d 100644
--- a/bin/varnishtest/tests/r01168.vtc
+++ b/bin/varnishtest/tests/r01168.vtc
@@ -11,8 +11,9 @@ server s1 {
} -start
varnish v1 -vcl+backend {
+ import std;
sub vcl_recv {
- rollback;
+ std.rollback(req);
}
sub vcl_backend_response {
set beresp.do_esi = true;
diff --git a/bin/varnishtest/tests/v00018.vtc b/bin/varnishtest/tests/v00018.vtc
index aae3723..9c653ba 100644
--- a/bin/varnishtest/tests/v00018.vtc
+++ b/bin/varnishtest/tests/v00018.vtc
@@ -2,12 +2,6 @@ varnishtest "VCL compiler coverage test: vcc_action.c"
varnish v1 -vcl {
backend b { .host = "127.0.0.1"; }
- sub vcl_hit { return (restart) ; }
- sub vcl_miss { rollback; return (restart); }
-}
-
-varnish v1 -vcl {
- backend b { .host = "127.0.0.1"; }
sub vcl_miss { return(synth(100,req.url)); }
sub vcl_hit { return(synth(100,"the butter please")); }
}
diff --git a/doc/sphinx/reference/vcl.rst b/doc/sphinx/reference/vcl.rst
index c982cb9..b8650f6 100644
--- a/doc/sphinx/reference/vcl.rst
+++ b/doc/sphinx/reference/vcl.rst
@@ -378,10 +378,6 @@ hash_data(input)
Adds an input to the hash input. In the built-in VCL hash_data()
is called on the host and URL of the *request*. Available in vcl_hash.
-rollback()
- Restore *req* HTTP headers to their original state. This function is
- deprecated. Use std.rollback() instead.
-
synthetic(STRING)
Prepare a synthetic response body containing the STRING. Available in
vcl_synth and vcl_backend_error.
diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c
index 790efea..516f628 100644
--- a/lib/libvcc/vcc_action.c
+++ b/lib/libvcc/vcc_action.c
@@ -376,16 +376,6 @@ parse_return(struct vcc *tl)
/*--------------------------------------------------------------------*/
static void
-parse_rollback(struct vcc *tl)
-{
-
- vcc_NextToken(tl);
- Fb(tl, 1, "VRT_Rollback(ctx, VRT_r_req(ctx));\n");
-}
-
-/*--------------------------------------------------------------------*/
-
-static void
parse_synthetic(struct vcc *tl)
{
vcc_NextToken(tl);
@@ -419,7 +409,6 @@ static struct action_table {
{ "hash_data", parse_hash_data, VCL_MET_HASH },
{ "new", parse_new, VCL_MET_INIT},
{ "return", parse_return },
- { "rollback", parse_rollback },
{ "set", parse_set },
{ "synthetic", parse_synthetic,
VCL_MET_SYNTH | VCL_MET_BACKEND_ERROR },
More information about the varnish-commit
mailing list