Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Commits

[master] 9d0e486 Don't consider a vcc expr to be constant after vcc_expr_tostring.

 

 

Varnish commits RSS feed   Index | Next | Previous | View Threaded


martin at varnish-cache

May 10, 2012, 2:50 AM

Post #1 of 1 (50 views)
Permalink
[master] 9d0e486 Don't consider a vcc expr to be constant after vcc_expr_tostring.

commit 9d0e486fe21199e6c059eb829f5d666611806012
Author: Martin Blix Grydeland <martin [at] varnish-software>
Date: Tue May 8 14:20:42 2012 +0200

Don't consider a vcc expr to be constant after vcc_expr_tostring.

Avoids vcc errors from constructs like "std.log("Test: " + 1);"

Fixes: #1134

diff --git a/bin/varnishtest/tests/r01134.vtc b/bin/varnishtest/tests/r01134.vtc
new file mode 100644
index 0000000..73f4e36
--- /dev/null
+++ b/bin/varnishtest/tests/r01134.vtc
@@ -0,0 +1,19 @@
+varnishtest "vcc const/non-const tostring conversion - bug 1134"
+
+server s1 {
+ rxreq
+ txresp
+} -start
+
+varnish v1 -vcl+backend {
+ sub vcl_recv {
+ set req.http.x-test = "Test " + 1;
+ }
+} -start
+
+client c1 {
+ txreq
+ rxresp
+ expect resp.status == 200
+} -run
+
diff --git a/lib/libvcl/vcc_expr.c b/lib/libvcl/vcc_expr.c
index 30e63d9..19a455c 100644
--- a/lib/libvcl/vcc_expr.c
+++ b/lib/libvcl/vcc_expr.c
@@ -434,8 +434,10 @@ vcc_expr_tostring(struct expr **e, enum var_type fmt)
case TIME: p = "VRT_time_string(sp, \v1)"; break;
default: break;
}
- if (p != NULL)
+ if (p != NULL) {
*e = vcc_expr_edit(fmt, p, *e, NULL);
+ (*e)->constant = 0;
+ }
}

/*--------------------------------------------------------------------

_______________________________________________
varnish-commit mailing list
varnish-commit [at] varnish-cache
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit

Varnish commits RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.