Commit 2f2ef590 authored by Nils Goroll's avatar Nils Goroll

clarify when we do (not) have ctx->msg

This tests that we are at least consistent, though not necessarily
correct

See #2902
parent 8f937e31
......@@ -286,7 +286,13 @@ struct vrt_ctx {
unsigned *handling;
unsigned vclver;
struct vsb *msg; // Only in ...init()
/*
* msg is for error messages and exists only for
* VCL_EVENT_LOAD
* VCL_EVENT_WARM
* VCL_EVENT_COLD
*/
struct vsb *msg;
struct vsl_log *vsl;
VCL_VCL vcl;
struct ws *ws;
......
......@@ -495,6 +495,8 @@ event_cold(VRT_CTX, const struct vmod_priv *priv)
pthread_t thread;
struct priv_vcl *priv_vcl;
AN(ctx->msg);
CAST_OBJ_NOTNULL(priv_vcl, priv->priv, PRIV_VCL_MAGIC);
VSL(SLT_Debug, 0, "%s: VCL_EVENT_COLD", VCL_Name(ctx->vcl));
......@@ -530,6 +532,8 @@ event_discard(VRT_CTX, void *priv)
(void)priv;
AZ(ctx->msg);
VRT_RemoveVFP(ctx, &xyzzy_rot13);
VRT_RemoveVDP(ctx, &xyzzy_vdp_rot13);
......@@ -557,7 +561,7 @@ xyzzy_event_function(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
case VCL_EVENT_WARM: return (event_warm(ctx, priv));
case VCL_EVENT_COLD: return (event_cold(ctx, priv));
case VCL_EVENT_DISCARD: return (event_discard(ctx, priv));
default: return (0);
default: WRONG("we should test all possible events");
}
}
......
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