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