[experimental-ims] 863c22b Allow relational comparisons on REAL type.

Geoff Simmons geoff at varnish-cache.org
Mon Jan 9 21:51:44 CET 2012


commit 863c22b821fae10287e110adb4aa6ba2f86494f6
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Aug 31 15:17:43 2011 +0000

    Allow relational comparisons on REAL type.
    
    Fixes	#1002

diff --git a/bin/varnishtest/tests/r01002.vtc b/bin/varnishtest/tests/r01002.vtc
new file mode 100644
index 0000000..12eb636
--- /dev/null
+++ b/bin/varnishtest/tests/r01002.vtc
@@ -0,0 +1,12 @@
+varnishtest "Real relational comparisons"
+
+varnish v1 -vcl {
+	import std from "${topbuild}/lib/libvmod_std/.libs/libvmod_std.so" ;
+
+	backend foo { .host = "${bad_ip}"; }
+	sub vcl_recv {
+		if (std.random(0,5) < 1.0) {
+			return (pipe);
+		}
+	}
+}
diff --git a/lib/libvcl/vcc_expr.c b/lib/libvcl/vcc_expr.c
index 0426299..3883dd2 100644
--- a/lib/libvcl/vcc_expr.c
+++ b/lib/libvcl/vcc_expr.c
@@ -886,6 +886,7 @@ static const struct cmps {
 	NUM_REL(INT),
 	NUM_REL(DURATION),
 	NUM_REL(BYTES),
+	NUM_REL(REAL),
 
 	{STRING,	T_EQ,	"!VRT_strcmp(\v1, \v2)" },
 	{STRING,	T_NEQ,	"VRT_strcmp(\v1, \v2)" },



More information about the varnish-commit mailing list