Commit 2fe1e1aa authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Centralize the req borrowing VCL from wrk

parent f0b50447
......@@ -821,6 +821,7 @@ cnt_recv_prep(struct req *req, const char *ci)
req->is_hitmiss = 0;
req->is_hitpass = 0;
}
/*--------------------------------------------------------------------
* We have a complete request, set everything up and start it.
* We can come here both with a request from the client and with
......@@ -1026,7 +1027,6 @@ CNT_Request(struct worker *wrk, struct req *req)
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
AN(req->vcl);
/*
* Possible entrance states
......@@ -1041,6 +1041,13 @@ CNT_Request(struct worker *wrk, struct req *req)
/* wrk can have changed for restarts */
req->vfc->wrk = req->wrk = wrk;
wrk->vsl = req->vsl;
if (req->req_step == R_STP_TRANSPORT) {
AZ(req->vcl);
VCL_Refresh(&wrk->vcl);
req->vcl = wrk->vcl;
wrk->vcl = NULL;
}
AN(req->vcl);
if (req->req_step != R_STP_LOOKUP)
VCL_TaskEnter(req->vcl, req->privs);
for (nxt = REQ_FSM_MORE; nxt == REQ_FSM_MORE; ) {
......
......@@ -281,11 +281,6 @@ http1_dissect(struct worker *wrk, struct req *req)
VSLb_ts_req(req, "Start", req->t_first);
VSLb_ts_req(req, "Req", req->t_req);
/* Borrow VCL reference from worker thread */
VCL_Refresh(&wrk->vcl);
req->vcl = wrk->vcl;
wrk->vcl = NULL;
HTTP_Setup(req->http, req->ws, req->vsl, SLT_ReqMethod);
req->err_code = HTTP1_DissectRequest(req->htc, req->http);
......
......@@ -661,9 +661,6 @@ h2_rx_headers(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
req->t_req = VTIM_real();
req->t_prev = req->t_first;
VSLb_ts_req(req, "Start", req->t_first);
VCL_Refresh(&wrk->vcl);
req->vcl = wrk->vcl;
wrk->vcl = NULL;
req->acct.req_hdrbytes += h2->rxf_len;
HTTP_Setup(req->http, req->ws, req->vsl, SLT_ReqMethod);
......
......@@ -239,8 +239,7 @@ h2_ou_rel(struct worker *wrk, struct req *req)
{
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
AN (req->vcl);
VCL_Rel(&req->vcl);
AZ(req->vcl);
Req_AcctLogCharge(wrk->stats, req);
Req_Release(req);
return (0);
......
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