Commit b211dd2e authored by Federico G. Schwindt's avatar Federico G. Schwindt

Retire rollback

This has been available via the std module for some time now.
OK'd by phk@.
parent d9e27bda
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
......@@ -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;
......
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)); }
......
......@@ -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.
......
......@@ -375,16 +375,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)
{
......@@ -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 },
......
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