[master] 0883512ed vmod_vtc: Add support for thread workspace operations on the backend side
Nils Goroll
nils.goroll at uplex.de
Mon Oct 28 12:12:05 UTC 2024
commit 0883512edae29bf516e749f3ad5e68df25942fb4
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Mon Oct 28 10:09:49 2024 +0100
vmod_vtc: Add support for thread workspace operations on the backend side
This is probably useless at the moment because of how the vcl method code checks
thread workspace allocations, but at least we avoid a panic at the wrong place.
diff --git a/vmod/vmod_vtc.c b/vmod/vmod_vtc.c
index 2d97b3543..191282b2b 100644
--- a/vmod/vmod_vtc.c
+++ b/vmod/vmod_vtc.c
@@ -142,8 +142,10 @@ vtc_ws_find(VRT_CTX, VCL_ENUM which)
return (ctx->bo->ws);
if (which == VENUM(session))
return (ctx->req->sp->ws);
- if (which == VENUM(thread))
+ if (which == VENUM(thread) && ctx->req != NULL)
return (ctx->req->wrk->aws);
+ if (which == VENUM(thread) && ctx->bo != NULL)
+ return (ctx->bo->wrk->aws);
WRONG("vtc_ws_find Illegal enum");
}
More information about the varnish-commit
mailing list