Commit 8a1948fa authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

BLOBs have a .tostring now, but test other type which do not.

parent ed278561
...@@ -388,6 +388,10 @@ varnish v1 -errvcl {Symbol 'acl' has wrong type (reserved), expected acl:} { ...@@ -388,6 +388,10 @@ varnish v1 -errvcl {Symbol 'acl' has wrong type (reserved), expected acl:} {
sub vcl_recv { if (client.ip ~ acl) {} } sub vcl_recv { if (client.ip ~ acl) {} }
} }
varnish v1 -errvcl {Cannot convert HTTP to STRING} {
sub vcl_synth { set resp.http.foo = resp; }
}
server s1 { server s1 {
rxreq rxreq
txresp -hdr "bar: X" txresp -hdr "bar: X"
......
...@@ -288,15 +288,9 @@ vcc_expr_tostring(struct vcc *tl, struct expr **e, vcc_type_t fmt) ...@@ -288,15 +288,9 @@ vcc_expr_tostring(struct vcc *tl, struct expr **e, vcc_type_t fmt)
(*e)->constant = constant; (*e)->constant = constant;
(*e)->nstr = 1; (*e)->nstr = 1;
} else { } else {
if ((*e)->fmt == BLOB) VSB_printf(tl->sb,
VSB_cat(tl->sb, "Cannot convert %s to STRING.\n",
"Wrong use of BLOB value.\n" vcc_utype((*e)->fmt));
"BLOBs can only be used as arguments to VMOD"
" functions.\n");
else
VSB_printf(tl->sb,
"Cannot convert %s to STRING.\n",
vcc_utype((*e)->fmt));
vcc_ErrWhere2(tl, (*e)->t1, tl->t); vcc_ErrWhere2(tl, (*e)->t1, tl->t);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment