[master] ac6b7f5c5 Enable calling vtc.barrier_sync() from vcl_init {}
Nils Goroll
nils.goroll at uplex.de
Fri Feb 11 09:58:07 UTC 2022
commit ac6b7f5c5d779826ee55aa2ae57224af4d84c06b
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Mon Feb 7 17:57:23 2022 +0100
Enable calling vtc.barrier_sync() from vcl_init {}
diff --git a/vmod/vmod_vtc.c b/vmod/vmod_vtc.c
index 8c3d8e7ba..06bab4bcd 100644
--- a/vmod/vmod_vtc.c
+++ b/vmod/vmod_vtc.c
@@ -57,7 +57,11 @@ vmod_barrier_sync(VRT_CTX, VCL_STRING addr, VCL_DURATION tmo)
AN(*addr);
assert(tmo >= 0.0);
- VSLb(ctx->vsl, SLT_Debug, "barrier_sync(\"%s\")", addr);
+ if (ctx->vsl != NULL)
+ VSLb(ctx->vsl, SLT_Debug, "barrier_sync(\"%s\")", addr);
+ else
+ VSL(SLT_Debug, 0, "barrier_sync(\"%s\")", addr);
+
sock = VTCP_open(addr, NULL, 0., &err);
if (sock < 0) {
VRT_fail(ctx, "Barrier connection failed: %s", err);
More information about the varnish-commit
mailing list