Commit 399bc4c1 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Call VCL_Onboard whenever a req or bo gets a particular VCL for the first time.

parent 3f9ca3fc
...@@ -133,6 +133,7 @@ VBO_GetBusyObj(struct worker *wrk, const struct req *req) ...@@ -133,6 +133,7 @@ VBO_GetBusyObj(struct worker *wrk, const struct req *req)
bo->director_req = req->director_hint; bo->director_req = req->director_hint;
bo->vcl = req->vcl; bo->vcl = req->vcl;
VCL_Ref(bo->vcl); VCL_Ref(bo->vcl);
VCL_Onboard(NULL, bo);
bo->t_first = bo->t_prev = NAN; bo->t_first = bo->t_prev = NAN;
......
...@@ -164,6 +164,7 @@ ved_include(struct req *preq, const char *src, const char *host, ...@@ -164,6 +164,7 @@ ved_include(struct req *preq, const char *src, const char *host,
AZ(req->vcl); AZ(req->vcl);
req->vcl = preq->vcl; req->vcl = preq->vcl;
preq->vcl = NULL; preq->vcl = NULL;
VCL_Onboard(req, NULL);
req->req_step = R_STP_RECV; req->req_step = R_STP_RECV;
req->t_req = preq->t_req; req->t_req = preq->t_req;
......
...@@ -388,6 +388,7 @@ void VCL_Poll(void); ...@@ -388,6 +388,7 @@ void VCL_Poll(void);
void VCL_Ref(struct vcl *); void VCL_Ref(struct vcl *);
void VCL_Refresh(struct vcl **); void VCL_Refresh(struct vcl **);
void VCL_Rel(struct vcl **); void VCL_Rel(struct vcl **);
void VCL_Onboard(struct req *, struct busyobj *);
const char *VCL_Return_Name(unsigned); const char *VCL_Return_Name(unsigned);
const char *VCL_Method_Name(unsigned); const char *VCL_Method_Name(unsigned);
void VCL_Bo2Ctx(struct vrt_ctx *, struct busyobj *); void VCL_Bo2Ctx(struct vrt_ctx *, struct busyobj *);
......
...@@ -76,6 +76,16 @@ VCL_Method_Name(unsigned m) ...@@ -76,6 +76,16 @@ VCL_Method_Name(unsigned m)
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
void
VCL_Onboard(struct req *req, struct busyobj *bo)
{
CHECK_OBJ_ORNULL(req, REQ_MAGIC);
CHECK_OBJ_ORNULL(bo, BUSYOBJ_MAGIC);
assert(req != NULL || bo != NULL);
assert(req == NULL || bo == NULL);
}
void void
VCL_Refresh(struct vcl **vcc) VCL_Refresh(struct vcl **vcc)
{ {
...@@ -329,6 +339,7 @@ VRT_vcl_select(VRT_CTX, VCL_VCL vcl) ...@@ -329,6 +339,7 @@ VRT_vcl_select(VRT_CTX, VCL_VCL vcl)
vcl_get(&req->vcl, vcl); vcl_get(&req->vcl, vcl);
/* XXX: better logging */ /* XXX: better logging */
VSLb(ctx->req->vsl, SLT_Debug, "Now using %s VCL", vcl->loaded_name); VSLb(ctx->req->vsl, SLT_Debug, "Now using %s VCL", vcl->loaded_name);
VCL_Onboard(req, NULL);
} }
struct vclref * struct vclref *
......
...@@ -330,6 +330,7 @@ http1_dissect(struct worker *wrk, struct req *req) ...@@ -330,6 +330,7 @@ http1_dissect(struct worker *wrk, struct req *req)
VCL_Refresh(&wrk->vcl); VCL_Refresh(&wrk->vcl);
req->vcl = wrk->vcl; req->vcl = wrk->vcl;
wrk->vcl = NULL; wrk->vcl = NULL;
VCL_Onboard(req, NULL);
HTTP_Setup(req->http, req->ws, req->vsl, SLT_ReqMethod); HTTP_Setup(req->http, req->ws, req->vsl, SLT_ReqMethod);
req->err_code = HTTP1_DissectRequest(req->htc, req->http); req->err_code = HTTP1_DissectRequest(req->htc, req->http);
......
...@@ -643,6 +643,7 @@ h2_rx_headers(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2) ...@@ -643,6 +643,7 @@ h2_rx_headers(struct worker *wrk, struct h2_sess *h2, struct h2_req *r2)
VCL_Refresh(&wrk->vcl); VCL_Refresh(&wrk->vcl);
req->vcl = wrk->vcl; req->vcl = wrk->vcl;
wrk->vcl = NULL; wrk->vcl = NULL;
VCL_Onboard(req, NULL);
req->acct.req_hdrbytes += h2->rxf_len; req->acct.req_hdrbytes += h2->rxf_len;
HTTP_Setup(req->http, req->ws, req->vsl, SLT_ReqMethod); HTTP_Setup(req->http, req->ws, req->vsl, SLT_ReqMethod);
......
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