Commit 3129d065 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Execute vcl_hash{} right after vcl_recv{}, so that vcl_pipe{} and vcl_pass{}

can trust the result to exist.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4392 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent ad0e1799
......@@ -775,12 +775,6 @@ cnt_lookup(struct sess *sp)
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(sp->vcl, VCL_CONF_MAGIC);
if (sp->obj == NULL) {
HSH_BeforeVclHash(sp);
VCL_hash_method(sp);
assert(sp->handling == VCL_RET_HASH);
HSH_AfterVclHash(sp);
}
oc = HSH_Lookup(sp, &oh);
......@@ -1015,6 +1009,7 @@ DOT recv -> hash [label="lookup",style=bold,color=green,weight=4]
static int
cnt_recv(struct sess *sp)
{
unsigned recv_handling;
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(sp->vcl, VCL_CONF_MAGIC);
......@@ -1030,6 +1025,8 @@ cnt_recv(struct sess *sp)
sp->disable_esi = 0;
VCL_recv_method(sp);
recv_handling = sp->handling;
if (sp->restarts >= params->max_restarts) {
if (sp->err_code == 0)
sp->err_code = 503;
......@@ -1037,6 +1034,11 @@ cnt_recv(struct sess *sp)
return (0);
}
HSH_BeforeVclHash(sp);
VCL_hash_method(sp);
assert(sp->handling == VCL_RET_HASH);
HSH_AfterVclHash(sp);
if (!strcmp(sp->http->hd[HTTP_HDR_REQ].b, "HEAD")) {
sp->wantbody = 0;
http_ForceGet(sp->http);
......@@ -1044,7 +1046,7 @@ cnt_recv(struct sess *sp)
sp->wantbody = 1;
sp->sendbody = 0;
switch(sp->handling) {
switch(recv_handling) {
case VCL_RET_LOOKUP:
/* XXX: discard req body, if any */
sp->step = STP_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