Commit ac979b67 authored by Nils Goroll's avatar Nils Goroll

always assign ctx->handling = &wrk->handling

This is option 'always add ctx->handling' from #2997:

we add the (struct vrt_ctx).handling pointer even where there is no VCL
method for consistency to enable use of VRT_fail() consistently.
parent bea1da6e
...@@ -77,6 +77,7 @@ VCL_Bo2Ctx(struct vrt_ctx *ctx, struct busyobj *bo) ...@@ -77,6 +77,7 @@ VCL_Bo2Ctx(struct vrt_ctx *ctx, struct busyobj *bo)
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC); CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
CHECK_OBJ_NOTNULL(bo->wrk, WORKER_MAGIC);
ctx->vcl = bo->vcl; ctx->vcl = bo->vcl;
ctx->vsl = bo->vsl; ctx->vsl = bo->vsl;
ctx->http_bereq = bo->bereq; ctx->http_bereq = bo->bereq;
...@@ -85,6 +86,8 @@ VCL_Bo2Ctx(struct vrt_ctx *ctx, struct busyobj *bo) ...@@ -85,6 +86,8 @@ VCL_Bo2Ctx(struct vrt_ctx *ctx, struct busyobj *bo)
ctx->sp = bo->sp; ctx->sp = bo->sp;
ctx->now = bo->t_prev; ctx->now = bo->t_prev;
ctx->ws = bo->ws; ctx->ws = bo->ws;
ctx->handling = &bo->wrk->handling;
*ctx->handling = 0;
} }
void void
...@@ -94,6 +97,7 @@ VCL_Req2Ctx(struct vrt_ctx *ctx, struct req *req) ...@@ -94,6 +97,7 @@ VCL_Req2Ctx(struct vrt_ctx *ctx, struct req *req)
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(req, REQ_MAGIC); CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
CHECK_OBJ_ORNULL(req->topreq, REQ_MAGIC); CHECK_OBJ_ORNULL(req->topreq, REQ_MAGIC);
CHECK_OBJ_NOTNULL(req->wrk, WORKER_MAGIC);
ctx->vcl = req->vcl; ctx->vcl = req->vcl;
ctx->vsl = req->vsl; ctx->vsl = req->vsl;
...@@ -104,6 +108,8 @@ VCL_Req2Ctx(struct vrt_ctx *ctx, struct req *req) ...@@ -104,6 +108,8 @@ VCL_Req2Ctx(struct vrt_ctx *ctx, struct req *req)
ctx->sp = req->sp; ctx->sp = req->sp;
ctx->now = req->t_prev; ctx->now = req->t_prev;
ctx->ws = req->ws; ctx->ws = req->ws;
ctx->handling = &req->wrk->handling;
*ctx->handling = 0;
} }
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
......
...@@ -441,8 +441,6 @@ vcl_call_method(struct worker *wrk, struct req *req, struct busyobj *bo, ...@@ -441,8 +441,6 @@ vcl_call_method(struct worker *wrk, struct req *req, struct busyobj *bo,
ctx.syntax = ctx.vcl->conf->syntax; ctx.syntax = ctx.vcl->conf->syntax;
ctx.specific = specific; ctx.specific = specific;
ctx.method = method; ctx.method = method;
wrk->handling = 0;
ctx.handling = &wrk->handling;
aws = WS_Snapshot(wrk->aws); aws = WS_Snapshot(wrk->aws);
wrk->cur_method = method; wrk->cur_method = method;
wrk->seen_methods |= method; wrk->seen_methods |= method;
......
...@@ -258,7 +258,7 @@ struct vrt_ctx { ...@@ -258,7 +258,7 @@ struct vrt_ctx {
unsigned syntax; unsigned syntax;
unsigned method; unsigned method;
unsigned *handling; // not in director context unsigned *handling;
unsigned vclver; unsigned vclver;
struct vsb *msg; // Only in ...init() struct vsb *msg; // Only in ...init()
......
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