Commit 390fa49f authored by Poul-Henning Kamp's avatar Poul-Henning Kamp
parents 9efa2b00 5b3e41b4
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
......@@ -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;
}
}
/*--------------------------------------------------------------------
......
......@@ -147,19 +147,18 @@ vmod_random(struct sess *sp, double lo, double hi)
void __match_proto__()
vmod_log(struct sess *sp, const char *fmt, ...)
{
char *p;
unsigned u;
va_list ap;
txt t;
u = WS_Reserve(sp->req->ws, 0);
p = sp->req->ws->f;
t.b = sp->req->ws->f;
va_start(ap, fmt);
p = VRT_StringList(p, u, fmt, ap);
t.e = VRT_StringList(t.b, u, fmt, ap);
va_end(ap);
if (p != NULL) {
t.b = p;
t.e = strchr(p, '\0');
if (t.e != NULL) {
assert(t.e > t.b);
t.e--;
VSLbt(sp->req->vsl, SLT_VCL_Log, t);
}
WS_Release(sp->req->ws, 0);
......
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