Skip to content
Permalink
Browse files

Teach libvcc how to set HEADER += STRING_LIST;

And avoid the indentation of characters in vcc_assign_expr().

Fixes #3079
Closes #3100
  • Loading branch information...
Dridi committed Nov 5, 2019
1 parent 94e6e03 commit d6127c3e4332bfd9ccb6b5edf777f040d1db776b
Showing with 28 additions and 2 deletions.
  1. +25 −0 bin/varnishtest/tests/r03079.vtc
  2. +3 −2 lib/libvcc/vcc_action.c
@@ -0,0 +1,25 @@
varnishtest "set VCL_??? += VCL_STRING;"

server s1 {
rxreq
expect req.url == "/hello/world"
expect req.http.host == helloworld
txresp -hdr "x-powered-by: varnishtest"
} -start

varnish v1 -vcl+backend {
sub vcl_backend_fetch {
set bereq.url += "/world";
set bereq.http.host += "world";
}
sub vcl_backend_response {
set beresp.http.x-powered-by += bereq.http.x-varnish;
}
} -start

client c1 {
txreq -url "/hello" -hdr "host: hello"
rxresp
expect resp.status == 200
expect resp.http.x-powered-by == varnishtest1002
} -run
@@ -82,6 +82,7 @@ static const struct assign {
{ DURATION, 0, DURATION },
{ STRING, T_INCR, STRING_LIST, "\v,\n" },
{ STRING, '=', STRING_LIST },
{ HEADER, T_INCR, STRING_LIST, "VRT_GetHdr(ctx, \v),\n" },
{ HEADER, '=', STRING_LIST },
{ BODY, '=', STRING_LIST },
{ VOID, '=', VOID }
@@ -98,9 +99,9 @@ vcc_assign_expr(struct vcc *tl, struct symbol *sym, const struct assign *ap)

while (*e != '\0') {
if (*e == '\v')
Fb(tl, 1, "%s", sym->rname);
Fb(tl, 0, "%s", sym->rname);
else
Fb(tl, 1, "%c", *e);
Fb(tl, 0, "%c", *e);
e++;
}
}

0 comments on commit d6127c3

Please sign in to comment.
You can’t perform that action at this time.