Skip to content
Permalink
Browse files

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.
  • Loading branch information...
nigoroll committed May 15, 2019
1 parent bea1da6 commit ac979b67f10b217912d4c596a5803af11c49cbb8
Showing with 7 additions and 3 deletions.
  1. +6 −0 bin/varnishd/cache/cache_vcl.c
  2. +0 −2 bin/varnishd/cache/cache_vrt_vcl.c
  3. +1 −1 include/vrt.h
@@ -77,6 +77,7 @@ VCL_Bo2Ctx(struct vrt_ctx *ctx, struct busyobj *bo)

CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
CHECK_OBJ_NOTNULL(bo->wrk, WORKER_MAGIC);
ctx->vcl = bo->vcl;
ctx->vsl = bo->vsl;
ctx->http_bereq = bo->bereq;
@@ -85,6 +86,8 @@ VCL_Bo2Ctx(struct vrt_ctx *ctx, struct busyobj *bo)
ctx->sp = bo->sp;
ctx->now = bo->t_prev;
ctx->ws = bo->ws;
ctx->handling = &bo->wrk->handling;
*ctx->handling = 0;
}

void
@@ -94,6 +97,7 @@ VCL_Req2Ctx(struct vrt_ctx *ctx, struct req *req)
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
CHECK_OBJ_ORNULL(req->topreq, REQ_MAGIC);
CHECK_OBJ_NOTNULL(req->wrk, WORKER_MAGIC);

ctx->vcl = req->vcl;
ctx->vsl = req->vsl;
@@ -104,6 +108,8 @@ VCL_Req2Ctx(struct vrt_ctx *ctx, struct req *req)
ctx->sp = req->sp;
ctx->now = req->t_prev;
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,
ctx.syntax = ctx.vcl->conf->syntax;
ctx.specific = specific;
ctx.method = method;
wrk->handling = 0;
ctx.handling = &wrk->handling;
aws = WS_Snapshot(wrk->aws);
wrk->cur_method = method;
wrk->seen_methods |= method;
@@ -258,7 +258,7 @@ struct vrt_ctx {

unsigned syntax;
unsigned method;
unsigned *handling; // not in director context
unsigned *handling;
unsigned vclver;

struct vsb *msg; // Only in ...init()

0 comments on commit ac979b6

Please sign in to comment.
You can’t perform that action at this time.