[master] 8ba2941 Add a test-case for r01644, even though I cannot reproduce the problem, it may be a platform thing, in which case Jenkins should go Technicrome after this commit...3...2...1...

Poul-Henning Kamp phk at FreeBSD.org
Tue Jan 6 13:52:56 CET 2015


commit 8ba2941b70d919e7c6c14be9527839e92802096c
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Jan 6 12:51:47 2015 +0000

    Add a test-case for r01644, even though I cannot reproduce the
    problem, it may be a platform thing, in which case Jenkins should
    go Technicrome after this commit...3...2...1...

diff --git a/bin/varnishtest/tests/r01644.vtc b/bin/varnishtest/tests/r01644.vtc
new file mode 100644
index 0000000..f845213
--- /dev/null
+++ b/bin/varnishtest/tests/r01644.vtc
@@ -0,0 +1,33 @@
+varnishtest "test access to cache_param from vmod"
+
+server s1 {
+	rxreq
+	txresp
+
+} -start
+
+varnish v1 -vcl+backend {
+	
+	import ${vmod_debug};
+
+	sub vcl_deliver {
+		set resp.http.foo = debug.vre_limit();
+	}
+
+} -start
+
+varnish v1 -cliok "param.set pcre_match_limit 100"
+
+client c1 {
+	txreq 
+	rxresp
+	expect resp.http.foo == 100
+} -run
+
+varnish v1 -cliok "param.set pcre_match_limit 200"
+
+client c1 {
+	txreq 
+	rxresp
+	expect resp.http.foo == 200
+} -run
diff --git a/lib/libvmod_debug/vmod.vcc b/lib/libvmod_debug/vmod.vcc
index a027779..cafd88d 100644
--- a/lib/libvmod_debug/vmod.vcc
+++ b/lib/libvmod_debug/vmod.vcc
@@ -91,3 +91,5 @@ Encrypt the HTTP header with quad-ROT13 encryption,
 (this is approx 33% better than triple-DES).
 
 $Function STRING argtest(STRING one, REAL two=2, STRING three="3")
+
+$Function INT vre_limit()
diff --git a/lib/libvmod_debug/vmod_debug.c b/lib/libvmod_debug/vmod_debug.c
index 500d154..1a5331b 100644
--- a/lib/libvmod_debug/vmod_debug.c
+++ b/lib/libvmod_debug/vmod_debug.c
@@ -168,3 +168,10 @@ vmod_argtest(VRT_CTX, VCL_STRING one, VCL_REAL two, VCL_STRING three)
 	bprintf(buf, "%s %g %s", one, two, three);
 	return WS_Copy(ctx->ws, buf, -1);
 }
+
+VCL_INT
+vmod_vre_limit(VRT_CTX)
+{
+	(void)ctx;
+	return (cache_param->vre_limits.match);
+}



More information about the varnish-commit mailing list