Commit 298475eb authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make the default return from recv and hash methods point to the

next method we'll end up in.
parent 3592eeda
...@@ -1172,7 +1172,7 @@ cnt_recv(struct worker *wrk, struct req *req) ...@@ -1172,7 +1172,7 @@ cnt_recv(struct worker *wrk, struct req *req)
req->sha256ctx = &sha256ctx; /* so HSH_AddString() can find it */ req->sha256ctx = &sha256ctx; /* so HSH_AddString() can find it */
SHA256_Init(req->sha256ctx); SHA256_Init(req->sha256ctx);
VCL_hash_method(req->vcl, wrk, req, NULL, req->http->ws); VCL_hash_method(req->vcl, wrk, req, NULL, req->http->ws);
assert(wrk->handling == VCL_RET_HASH); assert(wrk->handling == VCL_RET_LOOKUP);
SHA256_Final(req->digest, req->sha256ctx); SHA256_Final(req->digest, req->sha256ctx);
req->sha256ctx = NULL; req->sha256ctx = NULL;
...@@ -1182,7 +1182,7 @@ cnt_recv(struct worker *wrk, struct req *req) ...@@ -1182,7 +1182,7 @@ cnt_recv(struct worker *wrk, struct req *req)
req->wantbody = 1; req->wantbody = 1;
switch(recv_handling) { switch(recv_handling) {
case VCL_RET_LOOKUP: case VCL_RET_HASH:
req->req_step = R_STP_LOOKUP; req->req_step = R_STP_LOOKUP;
return (REQ_FSM_MORE); return (REQ_FSM_MORE);
case VCL_RET_PIPE: case VCL_RET_PIPE:
......
...@@ -66,7 +66,7 @@ sub vcl_recv { ...@@ -66,7 +66,7 @@ sub vcl_recv {
/* Not cacheable by default */ /* Not cacheable by default */
return (pass); return (pass);
} }
return (lookup); return (hash);
} }
sub vcl_pipe { sub vcl_pipe {
...@@ -90,7 +90,7 @@ sub vcl_hash { ...@@ -90,7 +90,7 @@ sub vcl_hash {
} else { } else {
hash_data(server.ip); hash_data(server.ip);
} }
return (hash); return (lookup);
} }
sub vcl_lookup { sub vcl_lookup {
......
...@@ -19,7 +19,7 @@ varnish v1 -vcl+backend { ...@@ -19,7 +19,7 @@ varnish v1 -vcl+backend {
sub vcl_recv { sub vcl_recv {
if (req.method == "PURGE") { if (req.method == "PURGE") {
return (lookup); return (hash);
} }
} }
......
...@@ -22,7 +22,7 @@ varnish v1 -vcl+backend { ...@@ -22,7 +22,7 @@ varnish v1 -vcl+backend {
sub vcl_recv { sub vcl_recv {
if (req.method == "POST") { if (req.method == "POST") {
/* Lookup so we find any cached object */ /* Lookup so we find any cached object */
return (lookup); return (hash);
} }
} }
sub vcl_lookup { sub vcl_lookup {
......
...@@ -14,7 +14,7 @@ varnish v1 -vcl+backend { ...@@ -14,7 +14,7 @@ varnish v1 -vcl+backend {
if (req.http.x-pass) { if (req.http.x-pass) {
return (pass); return (pass);
} else { } else {
return (lookup); return (hash);
} }
} }
} }
...@@ -23,7 +23,7 @@ varnish v1 -vcl+backend { ...@@ -23,7 +23,7 @@ varnish v1 -vcl+backend {
## Check if they have a ban in the cache, or if they are going to be banned in cache. ## Check if they have a ban in the cache, or if they are going to be banned in cache.
if (req.http.X-Banned) { if (req.http.X-Banned) {
hash_data(client.ip); hash_data(client.ip);
return (hash); return (lookup);
} }
} }
......
...@@ -18,7 +18,7 @@ varnish v1 -vcl+backend { ...@@ -18,7 +18,7 @@ varnish v1 -vcl+backend {
ban("obj.http.url ~ /"); ban("obj.http.url ~ /");
error 201 "banned"; error 201 "banned";
} }
return (lookup); return (hash);
} }
sub vcl_backend_response { sub vcl_backend_response {
set beresp.http.url = bereq.url; set beresp.http.url = bereq.url;
......
...@@ -15,7 +15,7 @@ varnish v1 -vcl+backend { ...@@ -15,7 +15,7 @@ varnish v1 -vcl+backend {
} else { } else {
hash_data("1" + req.http.foo + "3"); hash_data("1" + req.http.foo + "3");
} }
return (hash); return (lookup);
} }
} -start } -start
......
...@@ -78,10 +78,10 @@ tokens = { ...@@ -78,10 +78,10 @@ tokens = {
# Our methods and actions # Our methods and actions
returns =( returns =(
('recv', "C", ('error', 'pass', 'pipe', 'lookup',)), ('recv', "C", ('error', 'pass', 'pipe', 'hash',)),
('pipe', "C", ('error', 'pipe',)), ('pipe', "C", ('error', 'pipe',)),
('pass', "C", ('error', 'restart', 'pass',)), ('pass', "C", ('error', 'restart', 'pass',)),
('hash', "C", ('hash',)), ('hash', "C", ('lookup',)),
('miss', "C", ('error', 'restart', 'pass', 'fetch',)), ('miss', "C", ('error', 'restart', 'pass', 'fetch',)),
('lookup', "C", ('error', 'restart', 'pass', 'deliver',)), ('lookup', "C", ('error', 'restart', 'pass', 'deliver',)),
('backend_fetch', "B", ('fetch', 'pass',)), ('backend_fetch', "B", ('fetch', 'pass',)),
......
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