Skip to content

Commit

Permalink
Teach libvcc how to set HEADER += STRING_LIST;
Browse files Browse the repository at this point in the history
And avoid the indentation of characters in vcc_assign_expr().

Fixes #3079
Closes #3100
  • Loading branch information
Dridi committed Dec 2, 2019
1 parent 94e6e03 commit d6127c3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
25 changes: 25 additions & 0 deletions bin/varnishtest/tests/r03079.vtc
@@ -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
5 changes: 3 additions & 2 deletions lib/libvcc/vcc_action.c
Expand Up @@ -82,6 +82,7 @@ static const struct assign {
{ DURATION, 0, DURATION }, { DURATION, 0, DURATION },
{ STRING, T_INCR, STRING_LIST, "\v,\n" }, { STRING, T_INCR, STRING_LIST, "\v,\n" },
{ STRING, '=', STRING_LIST }, { STRING, '=', STRING_LIST },
{ HEADER, T_INCR, STRING_LIST, "VRT_GetHdr(ctx, \v),\n" },
{ HEADER, '=', STRING_LIST }, { HEADER, '=', STRING_LIST },
{ BODY, '=', STRING_LIST }, { BODY, '=', STRING_LIST },
{ VOID, '=', VOID } { VOID, '=', VOID }
Expand All @@ -98,9 +99,9 @@ vcc_assign_expr(struct vcc *tl, struct symbol *sym, const struct assign *ap)


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

0 comments on commit d6127c3

Please sign in to comment.