Commit 72a19f2f authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Isolate req->busyobj in the state engine.

parent 8489546f
...@@ -996,7 +996,7 @@ const char *reqbody_status_2str(enum req_body_state_e e); ...@@ -996,7 +996,7 @@ const char *reqbody_status_2str(enum req_body_state_e e);
const char *sess_close_2str(enum sess_close sc, int want_desc); const char *sess_close_2str(enum sess_close sc, int want_desc);
/* cache_pipe.c */ /* cache_pipe.c */
void PipeRequest(struct req *req); void PipeRequest(struct req *req, struct busyobj *bo);
/* cache_pool.c */ /* cache_pool.c */
void Pool_Init(void); void Pool_Init(void);
......
...@@ -60,19 +60,17 @@ rdf(int fd0, int fd1) ...@@ -60,19 +60,17 @@ rdf(int fd0, int fd1)
} }
void void
PipeRequest(struct req *req) PipeRequest(struct req *req, struct busyobj *bo)
{ {
struct vbc *vc; struct vbc *vc;
struct worker *wrk; struct worker *wrk;
struct pollfd fds[2]; struct pollfd fds[2];
struct busyobj *bo;
int i; int i;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC); CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
CHECK_OBJ_NOTNULL(req->sp, SESS_MAGIC); CHECK_OBJ_NOTNULL(req->sp, SESS_MAGIC);
wrk = req->wrk; wrk = req->wrk;
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
bo = req->busyobj;
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC); CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
vc = VDI_GetFd(NULL, bo); vc = VDI_GetFd(NULL, bo);
......
...@@ -685,23 +685,22 @@ cnt_pipe(struct worker *wrk, struct req *req) ...@@ -685,23 +685,22 @@ cnt_pipe(struct worker *wrk, struct req *req)
AZ(req->busyobj); AZ(req->busyobj);
req->acct_req.pipe++; req->acct_req.pipe++;
req->busyobj = VBO_GetBusyObj(wrk, req); bo = VBO_GetBusyObj(wrk, req);
bo = req->busyobj;
HTTP_Setup(bo->bereq, bo->ws, bo->vsl, HTTP_Bereq); HTTP_Setup(bo->bereq, bo->ws, bo->vsl, HTTP_Bereq);
http_FilterReq(bo->bereq, req->http, 0); // XXX: 0 ? http_FilterReq(bo->bereq, req->http, 0); // XXX: 0 ?
http_PrintfHeader(bo->bereq, http_PrintfHeader(bo->bereq,
"X-Varnish: %u", req->vsl->wid & VSL_IDENTMASK); "X-Varnish: %u", req->vsl->wid & VSL_IDENTMASK);
VCL_pipe_method(req->vcl, wrk, req, NULL, req->http->ws); VCL_pipe_method(req->vcl, wrk, req, bo, req->http->ws);
if (wrk->handling == VCL_RET_ERROR) if (wrk->handling == VCL_RET_ERROR)
INCOMPL(); INCOMPL();
assert(wrk->handling == VCL_RET_PIPE); assert(wrk->handling == VCL_RET_PIPE);
PipeRequest(req); PipeRequest(req, bo);
assert(WRW_IsReleased(wrk)); assert(WRW_IsReleased(wrk));
http_Teardown(bo->bereq); http_Teardown(bo->bereq);
VBO_DerefBusyObj(wrk, &req->busyobj); VBO_DerefBusyObj(wrk, &bo);
return (REQ_FSM_DONE); return (REQ_FSM_DONE);
} }
......
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