Commit f4e2634a authored by Kristian Lyngstøl's avatar Kristian Lyngstøl

Update vcl(7) for 2.1: return(foo) is mandatory.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5067 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent e3d02c13
...@@ -229,7 +229,7 @@ enclosed in parentheses, however, it will simply be ignored. ...@@ -229,7 +229,7 @@ enclosed in parentheses, however, it will simply be ignored.
To match an IP address against an ACL, simply use the match operator::: To match an IP address against an ACL, simply use the match operator:::
if (client.ip ~ local) { if (client.ip ~ local) {
pipe; return (pipe);
} }
Grace Grace
...@@ -276,7 +276,7 @@ A subroutine is used to group code for legibility or reusability::: ...@@ -276,7 +276,7 @@ A subroutine is used to group code for legibility or reusability:::
sub pipe_if_local { sub pipe_if_local {
if (client.ip ~ local) { if (client.ip ~ local) {
pipe; return (pipe);
} }
} }
...@@ -594,8 +594,8 @@ Values may be assigned to variables using the set keyword::: ...@@ -594,8 +594,8 @@ Values may be assigned to variables using the set keyword:::
# Normalize the Host: header # Normalize the Host: header
if (req.http.host ~ "^(www.)?example.com$") { if (req.http.host ~ "^(www.)?example.com$") {
set req.http.host = "www.example.com"; set req.http.host = "www.example.com";
} }
} }
HTTP headers can be removed entirely using the remove keyword::: HTTP headers can be removed entirely using the remove keyword:::
...@@ -651,7 +651,7 @@ based on the request URL::: ...@@ -651,7 +651,7 @@ based on the request URL:::
sub vcl_fetch { sub vcl_fetch {
if (obj.ttl < 120s) { if (obj.ttl < 120s) {
set obj.ttl = 120s; set obj.ttl = 120s;
} }
} }
...@@ -660,13 +660,13 @@ documents even when cookies are present::: ...@@ -660,13 +660,13 @@ documents even when cookies are present:::
sub vcl_recv { sub vcl_recv {
if (req.request == "GET" && req.http.cookie) { if (req.request == "GET" && req.http.cookie) {
call(lookup); return(lookup);
} }
} }
sub vcl_fetch { sub vcl_fetch {
if (beresp.http.Set-Cookie) { if (beresp.http.Set-Cookie) {
deliver; return(deliver);
} }
} }
...@@ -680,10 +680,10 @@ for object invalidation::: ...@@ -680,10 +680,10 @@ for object invalidation:::
sub vcl_recv { sub vcl_recv {
if (req.request == "PURGE") { if (req.request == "PURGE") {
if (!client.ip ~ purge) { if (!client.ip ~ purge) {
error 405 "Not allowed."; error 405 "Not allowed.";
} }
lookup; return(lookup);
} }
} }
......
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