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

Eliminate the prepfetch state

parent ee1f86d2
...@@ -550,8 +550,8 @@ DOT shape=record ...@@ -550,8 +550,8 @@ DOT shape=record
DOT label="{cnt_fetch:|fetch hdr\nfrom backend|(find obj.ttl)|{vcl_fetch\{\}|{req.|bereq.|beresp.}}|{<err>error?|<rst>restart?}}" DOT label="{cnt_fetch:|fetch hdr\nfrom backend|(find obj.ttl)|{vcl_fetch\{\}|{req.|bereq.|beresp.}}|{<err>error?|<rst>restart?}}"
DOT ] DOT ]
DOT } DOT }
DOT fetch -> prepfetch [style=bold,color=red] DOT fetch -> fetchbody [style=bold,color=red]
DOT fetch -> prepfetch [style=bold,color=blue] DOT fetch -> fetchbody [style=bold,color=blue]
*/ */
static int static int
...@@ -630,7 +630,7 @@ cnt_fetch(struct sess *sp, struct worker *wrk, struct req *req) ...@@ -630,7 +630,7 @@ cnt_fetch(struct sess *sp, struct worker *wrk, struct req *req)
switch (req->handling) { switch (req->handling) {
case VCL_RET_DELIVER: case VCL_RET_DELIVER:
sp->step = STP_PREPFETCH; sp->step = STP_FETCHBODY;
return (0); return (0);
default: default:
break; break;
...@@ -670,18 +670,17 @@ cnt_fetch(struct sess *sp, struct worker *wrk, struct req *req) ...@@ -670,18 +670,17 @@ cnt_fetch(struct sess *sp, struct worker *wrk, struct req *req)
* Prepare to fetch body from backend * Prepare to fetch body from backend
* *
DOT subgraph xcluster_body { DOT subgraph xcluster_body {
DOT prepfetch [ DOT fetchbody [
DOT shape=record DOT shape=record
DOT label="{cnt_prepfetch:|error?|<out>stream ?}" DOT label="{cnt_fetchbody:|start fetch_thread}"
DOT ] DOT ]
DOT } DOT }
DOT prepfetch:out -> fetchbody [style=bold,color=red] DOT fetchbody:out -> prepresp [style=bold,color=red]
DOT prepfetch:out -> fetchbody [style=bold,color=blue] DOT fetchbody:out -> prepresp [style=bold,color=blue]
DOT prepfetch:out -> prepresp [label=yes,style=bold,color=cyan]
*/ */
static int static int
cnt_prepfetch(struct sess *sp, struct worker *wrk, struct req *req) cnt_fetchbody(struct sess *sp, struct worker *wrk, struct req *req)
{ {
struct http *hp, *hp2; struct http *hp, *hp2;
char *b; char *b;
...@@ -868,34 +867,9 @@ cnt_prepfetch(struct sess *sp, struct worker *wrk, struct req *req) ...@@ -868,34 +867,9 @@ cnt_prepfetch(struct sess *sp, struct worker *wrk, struct req *req)
RFC2616_Do_Cond(sp)) RFC2616_Do_Cond(sp))
bo->do_stream = 0; bo->do_stream = 0;
sp->step = STP_FETCHBODY; /*
return (0); * Ready to fetch the body
} */
/*--------------------------------------------------------------------
* Actually fetch body from backend
*
DOT subgraph xcluster_fetchbody {
DOT fetchbody [
DOT shape=record
DOT label="{cnt_fetchbody:|error ?|<out>success ?}"
DOT ]
DOT }
DOT fetchbody:out -> prepresp [style=bold,color=red]
DOT fetchbody:out -> prepresp [style=bold,color=blue]
*/
static int
cnt_fetchbody(struct sess *sp, struct worker *wrk, struct req *req)
{
struct busyobj *bo;
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
bo = req->busyobj;
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
bo->fetch_task.func = FetchBody; bo->fetch_task.func = FetchBody;
bo->fetch_task.priv = bo; bo->fetch_task.priv = bo;
...@@ -1707,5 +1681,3 @@ CNT_Init(void) ...@@ -1707,5 +1681,3 @@ CNT_Init(void)
xids = random(); xids = random();
CLI_AddFuncs(debug_cmds); CLI_AddFuncs(debug_cmds);
} }
...@@ -40,7 +40,6 @@ STEP(lookup, LOOKUP, (sp, sp->wrk, sp->req)) ...@@ -40,7 +40,6 @@ STEP(lookup, LOOKUP, (sp, sp->wrk, sp->req))
STEP(miss, MISS, (sp, sp->wrk, sp->req)) STEP(miss, MISS, (sp, sp->wrk, sp->req))
STEP(hit, HIT, (sp, sp->wrk, sp->req)) STEP(hit, HIT, (sp, sp->wrk, sp->req))
STEP(fetch, FETCH, (sp, sp->wrk, sp->req)) STEP(fetch, FETCH, (sp, sp->wrk, sp->req))
STEP(prepfetch, PREPFETCH, (sp, sp->wrk, sp->req))
STEP(fetchbody, FETCHBODY, (sp, sp->wrk, sp->req)) STEP(fetchbody, FETCHBODY, (sp, sp->wrk, sp->req))
STEP(prepresp, PREPRESP, (sp, sp->wrk, sp->req)) STEP(prepresp, PREPRESP, (sp, sp->wrk, sp->req))
STEP(deliver, DELIVER, (sp, sp->wrk, sp->req)) STEP(deliver, DELIVER, (sp, sp->wrk, sp->req))
......
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