[master] 1e0e7b4 Remove backward compatibility
Federico G. Schwindt
fgsch at lodoss.net
Mon Feb 17 22:07:58 CET 2014
commit 1e0e7b4cb1dc4330ee0cacae89b971c4c1caaa1a
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date: Mon Feb 17 21:04:38 2014 +0000
Remove backward compatibility
This kills `remove', `.request' and `.response'. Use `unset', `.method'
and `.reason' instead.
ok phk.
diff --git a/bin/varnishtest/tests/b00018.vtc b/bin/varnishtest/tests/b00018.vtc
index 3989b57..682c19c 100644
--- a/bin/varnishtest/tests/b00018.vtc
+++ b/bin/varnishtest/tests/b00018.vtc
@@ -9,7 +9,7 @@ varnish v1 -vcl+backend {
sub vcl_backend_response {
set beresp.http.Foo = "bar";
set beresp.status = 523;
- set beresp.response = "not ok";
+ set beresp.reason = "not ok";
set beresp.uncacheable = true;
set beresp.ttl = 0s;
return (deliver);
diff --git a/bin/varnishtest/tests/b00019.vtc b/bin/varnishtest/tests/b00019.vtc
index 6b33702..597e8b9 100644
--- a/bin/varnishtest/tests/b00019.vtc
+++ b/bin/varnishtest/tests/b00019.vtc
@@ -28,13 +28,13 @@ varnish v1 -vcl+backend {
sub vcl_error {
if (req.restarts == 2) {
set obj.status = 200;
- set obj.response = "restart=2";
+ set obj.reason = "restart=2";
} elsif (req.restarts > 2) {
set obj.status = 501;
- set obj.response = "restart>2";
+ set obj.reason = "restart>2";
} elsif (req.restarts < 2) {
set obj.status = 500;
- set obj.response = "restart<2";
+ set obj.reason = "restart<2";
}
}
} -start
diff --git a/bin/varnishtest/tests/b00035.vtc b/bin/varnishtest/tests/b00035.vtc
deleted file mode 100644
index dbe8a6f..0000000
--- a/bin/varnishtest/tests/b00035.vtc
+++ /dev/null
@@ -1,26 +0,0 @@
-varnishtest "{be}req.request compat check"
-
-server s1 {
- rxreq
- expect req.method == "GETABCD"
- txresp
-} -start
-
-varnish v1 -vcl+backend {
-
- sub vcl_recv {
- set req.method = req.request + "A";
- set req.request = req.method + "B";
- return (pass);
- }
-
- sub vcl_backend_fetch {
- set bereq.method = bereq.request + "C";
- set bereq.request = bereq.method + "D";
- }
-} -start
-
-client c1 {
- txreq
- rxresp
-} -run
diff --git a/bin/varnishtest/tests/b00036.vtc b/bin/varnishtest/tests/b00036.vtc
index cb0b6e5..4cd6e17 100644
--- a/bin/varnishtest/tests/b00036.vtc
+++ b/bin/varnishtest/tests/b00036.vtc
@@ -9,7 +9,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_recv {
- if (req.request == "PURGE") {
+ if (req.method == "PURGE") {
return (purge);
}
}
diff --git a/bin/varnishtest/tests/r00292.vtc b/bin/varnishtest/tests/r00292.vtc
index f6bc807..4972188 100644
--- a/bin/varnishtest/tests/r00292.vtc
+++ b/bin/varnishtest/tests/r00292.vtc
@@ -18,8 +18,8 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_recv {
- remove req.http.hdr1;
- remove req.http.hdr5;
+ unset req.http.hdr1;
+ unset req.http.hdr5;
}
} -start
diff --git a/bin/varnishtest/tests/r00494.vtc b/bin/varnishtest/tests/r00494.vtc
index 31a9d6e..cb0bbe8 100644
--- a/bin/varnishtest/tests/r00494.vtc
+++ b/bin/varnishtest/tests/r00494.vtc
@@ -11,7 +11,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_backend_response {
set beresp.http.bar = beresp.http.foo;
- remove beresp.http.foo;
+ unset beresp.http.foo;
}
} -start
diff --git a/bin/varnishtest/tests/r00965.vtc b/bin/varnishtest/tests/r00965.vtc
index 72317de..ccd01b5 100644
--- a/bin/varnishtest/tests/r00965.vtc
+++ b/bin/varnishtest/tests/r00965.vtc
@@ -8,7 +8,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_recv {
if (req.http.X-Banned == "check") {
- remove req.http.X-Banned;
+ unset req.http.X-Banned;
} elseif (req.restarts == 0) {
set req.http.X-Banned = "check";
if (req.http.x-pass) {
diff --git a/bin/varnishtest/tests/v00001.vtc b/bin/varnishtest/tests/v00001.vtc
index 4f77f25..1798ec9 100644
--- a/bin/varnishtest/tests/v00001.vtc
+++ b/bin/varnishtest/tests/v00001.vtc
@@ -1,4 +1,4 @@
-varnishtest "VCL/VRT: url/request/proto/response/status"
+varnishtest "VCL/VRT: url/request/proto/reason/status"
server s1 {
@@ -28,14 +28,14 @@ varnish v1 -vcl+backend {
}
sub vcl_backend_response {
set beresp.http.foobar =
- beresp.proto + beresp.response + beresp.status;
+ beresp.proto + beresp.reason + beresp.status;
set beresp.proto = "HTTP/1.2";
- set beresp.response = "For circular files";
+ set beresp.reason = "For circular files";
set beresp.status = 903;
}
sub vcl_deliver {
set resp.proto = "HTTP/1.2";
- set resp.response = "Naah, lets fail it";
+ set resp.reason = "Naah, lets fail it";
set resp.status = 904;
# XXX should be moved to it's own test
set resp.http.x-served-by-hostname = server.hostname;
diff --git a/doc/sphinx/reference/vcl.rst b/doc/sphinx/reference/vcl.rst
index 8cb7439..9f384f8 100644
--- a/doc/sphinx/reference/vcl.rst
+++ b/doc/sphinx/reference/vcl.rst
@@ -662,9 +662,6 @@ server.identity
req.method
The request type (e.g. "GET", "HEAD").
-req.request
- For backward compatibility. Same as req.method.
-
req.url
The requested URL.
@@ -714,9 +711,6 @@ request (either for a cache miss or for pass or pipe mode):
bereq.method
The request type (e.g. "GET", "HEAD").
-bereq.request
- For backward compatibility. Same as bereq.method.
-
bereq.url
The requested URL.
@@ -759,9 +753,6 @@ beresp.status
beresp.reason
The HTTP status message returned by the server.
-beresp.response
- For backward compatibility. Same as beresp.reason.
-
beresp.http.header
The corresponding HTTP header.
@@ -821,9 +812,6 @@ obj.status
obj.reason
The HTTP status message returned by the server.
-obj.response
- For backward compatibility. Same as obj.reason.
-
obj.http.header
The corresponding HTTP header.
@@ -859,9 +847,6 @@ resp.status
resp.reason
The HTTP status message that will be returned.
-resp.response
- For backward compatibility. Same as resp.reason.
-
resp.http.header
The corresponding HTTP header.
diff --git a/lib/libvcc/generate.py b/lib/libvcc/generate.py
index 01a6243..466bf6b 100755
--- a/lib/libvcc/generate.py
+++ b/lib/libvcc/generate.py
@@ -578,11 +578,6 @@ The client's IP address.
# Backwards compatibility:
aliases = [
- ('req.request', 'req.method'),
- ('bereq.request', 'bereq.method'),
- ('beresp.response', 'beresp.reason'),
- ('resp.response', 'resp.reason'),
- ('obj.response', 'obj.reason'),
]
stv_variables = (
diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c
index 7e9bf2e..b0f7d98 100644
--- a/lib/libvcc/vcc_action.c
+++ b/lib/libvcc/vcc_action.c
@@ -411,7 +411,6 @@ static struct action_table {
{ "hash_data", parse_hash_data, VCL_MET_HASH },
{ "new", parse_new, VCL_MET_INIT},
{ "purge", parse_purge, VCL_MET_MISS | VCL_MET_HIT },
- { "remove", parse_unset }, /* backward compatibility */
{ "return", parse_return },
{ "rollback", parse_rollback },
{ "set", parse_set },
More information about the varnish-commit
mailing list