Commit ffe4da24 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

After trying several different ways, rename vcl_hit{} to vcl_lookup{},

that seems to be the shortest path from A to B.

(Please don't update docs yet, this is just a transition state)
parent 2980d244
......@@ -744,7 +744,7 @@ cnt_hit(struct worker *wrk, struct req *req)
assert(!(req->obj->objcore->flags & OC_F_PASS));
VCL_hit_method(req);
VCL_lookup_method(req);
if (req->handling == VCL_RET_DELIVER) {
//AZ(req->busyobj->bereq->ws);
......
......@@ -530,7 +530,7 @@ VRT_purge(struct req *req, double ttl, double grace)
{
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
if (req->cur_method == VCL_MET_HIT)
if (req->cur_method == VCL_MET_LOOKUP)
HSH_Purge(req, req->obj->objcore->objhead, ttl, grace);
else if (req->cur_method == VCL_MET_MISS)
HSH_Purge(req, req->objcore->objhead, ttl, grace);
......
......@@ -93,7 +93,7 @@ sub vcl_hash {
return (hash);
}
sub vcl_hit {
sub vcl_lookup {
return (deliver);
}
......
......@@ -10,7 +10,7 @@ server s1 {
} -start
varnish v1 -vcl+backend {
sub vcl_hit {
sub vcl_lookup {
return(pass);
}
} -start
......
......@@ -23,7 +23,7 @@ varnish v1 -vcl+backend {
}
}
sub vcl_hit {
sub vcl_lookup {
if (req.method == "PURGE") {
C{ VRT_purge(req, 0, 0); }C
error 456 "got it";
......
......@@ -40,7 +40,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_miss { if (req.http.purge == "yes") { purge; } }
sub vcl_hit { if (req.http.purge == "yes") { purge; return(restart);} }
sub vcl_lookup { if (req.http.purge == "yes") { purge; return(restart);} }
} -start
client c1 {
......
......@@ -24,7 +24,7 @@ client c1 {
varnish v1 -stop
varnish v1 -vcl+backend {
sub vcl_hit {
sub vcl_lookup {
set obj.ttl = 1 s;
}
}
......
varnishtest "Test obj.http.x-cache in vcl_hit"
varnishtest "Test obj.http.x-cache in vcl_lookup"
varnish v1 -errvcl {'obj.http.x-cache': cannot be set in method 'vcl_hit'.} {
varnish v1 -errvcl {'obj.http.x-cache': cannot be set in method 'vcl_lookup'.} {
backend foo { .host = "localhost"; }
sub vcl_hit {
sub vcl_lookup {
set obj.http.x-cache = "hit";
}
}
varnishtest "Test restarts in vcl_hit"
varnishtest "Test restarts in vcl_lookup"
server s1 {
rxreq
......@@ -10,7 +10,7 @@ server s1 {
} -start
varnish v1 -vcl+backend {
sub vcl_hit {
sub vcl_lookup {
set obj.ttl = 0s;
return (restart);
}
......
......@@ -11,7 +11,7 @@ server s1 {
} -start
varnish v1 -vcl+backend {
sub vcl_hit {
sub vcl_lookup {
if (obj.http.X-Magic-Redirect == "1") {
set req.url = obj.http.Location;
return (restart);
......
......@@ -19,7 +19,7 @@ varnish v1 -vcl+backend {
return (restart);
}
}
sub vcl_hit {
sub vcl_lookup {
if (obj.http.X-Magic-Redirect == "1") {
set req.url = obj.http.Location;
return (restart);
......
......@@ -25,7 +25,7 @@ varnish v1 -vcl+backend {
return (lookup);
}
}
sub vcl_hit {
sub vcl_lookup {
if (req.method == "POST") {
/* Get rid of this object */
set obj.ttl = 0s;
......
......@@ -11,7 +11,7 @@ varnish v1 -vcl+backend {
set req.http.foo = beresp.ttl;
set req.http.bar = "xxx";
}
sub vcl_hit {
sub vcl_lookup {
set req.http.foo = obj.ttl;
set obj.ttl = 7s;
set obj.grace = 120s;
......
......@@ -15,7 +15,7 @@ server s1 {
} -start
varnish v1 -vcl+backend {
sub vcl_hit {
sub vcl_lookup {
if (req.url == "/hit") {
return(restart);
}
......
......@@ -2,7 +2,7 @@ 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_lookup { return (restart) ; }
sub vcl_miss { rollback; return (restart); }
}
......
......@@ -10,7 +10,7 @@ server s1 {
} -start
varnish v1 -vcl+backend {
sub vcl_hit {
sub vcl_lookup {
set obj.ttl = 0s;
return (restart);
}
......
......@@ -28,7 +28,7 @@ sub vcl_response {
}
}
sub vcl_hit {
sub vcl_lookup {
if (obj.grace < 3m) {
set obj.grace = 1m;
} else {
......
......@@ -83,7 +83,7 @@ returns =(
('pass', ('error', 'restart', 'pass',)),
('hash', ('hash',)),
('miss', ('error', 'restart', 'pass', 'fetch',)),
('hit', ('error', 'restart', 'pass', 'deliver',)),
('lookup', ('error', 'restart', 'pass', 'deliver',)),
('fetch', ('error', 'fetch', 'pass',)),
('response', ('error', 'restart', 'deliver',)),
('deliver', ('restart', 'deliver',)),
......@@ -389,8 +389,8 @@ sp_variables = (
),
('obj.proto',
'STRING',
( 'hit', 'error',),
( 'hit', 'error',),
( 'lookup', 'error',),
( 'lookup', 'error',),
'const struct req *'
),
('obj.status',
......@@ -407,37 +407,37 @@ sp_variables = (
),
('obj.hits',
'INT',
( 'hit', 'deliver',),
( 'lookup', 'deliver',),
( ),
'const struct req *'
),
('obj.http.',
'HEADER',
( 'hit', 'error',),
( 'lookup', 'error',),
( 'error',), # XXX ?
'const struct req *'
),
('obj.ttl',
'DURATION',
( 'hit', 'error',),
( 'hit', 'error',),
( 'lookup', 'error',),
( 'lookup', 'error',),
'struct req *'
),
('obj.grace',
'DURATION',
( 'hit', 'error',),
( 'hit', 'error',),
( 'lookup', 'error',),
( 'lookup', 'error',),
'struct req *'
),
('obj.keep',
'DURATION',
( 'hit', 'error',),
( 'hit', 'error',),
( 'lookup', 'error',),
( 'lookup', 'error',),
'struct req *'
),
('obj.lastuse',
'DURATION',
( 'hit', 'deliver', 'error',),
( 'lookup', 'deliver', 'error',),
( ),
'const struct req *'
),
......
......@@ -372,7 +372,7 @@ static struct action_table {
} action_table[] = {
{ "error", parse_error,
VCL_MET_RECV | VCL_MET_PIPE | VCL_MET_PASS | VCL_MET_HASH |
VCL_MET_MISS | VCL_MET_HIT | VCL_MET_RESPONSE
VCL_MET_MISS | VCL_MET_LOOKUP | VCL_MET_RESPONSE
},
#define VCL_RET_MAC(l, U, B) \
......@@ -390,7 +390,7 @@ static struct action_table {
{ "set", parse_set },
{ "synthetic", parse_synthetic, VCL_MET_ERROR },
{ "unset", parse_unset },
{ "purge", parse_purge, VCL_MET_MISS | VCL_MET_HIT },
{ "purge", parse_purge, VCL_MET_MISS | VCL_MET_LOOKUP },
{ "new", parse_new, VCL_MET_INIT},
{ NULL, NULL }
};
......
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