[master] 270c873ea Add regression-test for #4146
Nils Goroll
nils.goroll at uplex.de
Fri Aug 16 10:42:06 UTC 2024
commit 270c873ea767ee7a259cb448c9f9b2981048fedc
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Thu Aug 1 12:08:54 2024 +0200
Add regression-test for #4146
diff --git a/bin/varnishtest/tests/v00019.vtc b/bin/varnishtest/tests/v00019.vtc
index c3c3d3543..1e0216a20 100644
--- a/bin/varnishtest/tests/v00019.vtc
+++ b/bin/varnishtest/tests/v00019.vtc
@@ -109,6 +109,17 @@ varnish v1 -vcl {
}
}
+# regression test #4146
+varnish v1 -vcl {
+ import debug;
+ backend be none;
+ sub vcl_init {
+ if (! debug.is_null_strands(debug.return_strands(debug.return_null_strands()))) {
+ return (fail("should load"));
+ }
+ }
+}
+
varnish v1 -errvcl {Symbol not found: 'req.http.req.http.foo'} {
backend b { .host = "${localhost}"; }
sub vcl_recv {
diff --git a/vmod/vmod_debug.c b/vmod/vmod_debug.c
index 026ca0dd5..c9b05c4db 100644
--- a/vmod/vmod_debug.c
+++ b/vmod/vmod_debug.c
@@ -984,6 +984,20 @@ xyzzy_return_strands(VRT_CTX, VCL_STRANDS strand)
return (strand);
}
+VCL_STRANDS
+xyzzy_return_null_strands(VRT_CTX)
+{
+ (void)ctx;
+ return (vrt_null_strands);
+}
+
+VCL_BOOL
+xyzzy_is_null_strands(VRT_CTX, VCL_STRANDS s)
+{
+ (void)ctx;
+ return (s == vrt_null_strands);
+}
+
VCL_VOID
xyzzy_vsl_flush(VRT_CTX)
{
diff --git a/vmod/vmod_debug.vcc b/vmod/vmod_debug.vcc
index f9427a62f..dbadb9d77 100644
--- a/vmod/vmod_debug.vcc
+++ b/vmod/vmod_debug.vcc
@@ -279,6 +279,10 @@ Test object method with all the fancy stuff.
$Function STRANDS return_strands(STRANDS strand)
+$Function STRANDS return_null_strands()
+
+$Function BOOL is_null_strands(STRANDS strand)
+
$Function VOID vsl_flush()
call VSL_Flush(ctx->cts, 0)
More information about the varnish-commit
mailing list