Commit 516e69e0 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Fix an indentation bug, which caused too much input data to be made

"pending" if an input snippet ended with an XML comment or CDATA block.

Not spotted by:	FlexeLint

Fixes: #873
parent 9c474268
......@@ -226,6 +226,7 @@ vfp_esi_bytes_ug(struct sess *sp, struct http_conn *htc, ssize_t bytes)
bytes -= w;
vef->bufp = ibuf;
VEP_parse(sp, ibuf, w);
assert(vef->bufp >= ibuf && vef->bufp <= ibuf + w);
if (vef->error) {
errno = vef->error;
return (-1);
......
......@@ -698,6 +698,7 @@ VEP_parse(const struct sess *sp, const char *p, size_t l)
vep->until_p = vep->until = "-->";
vep->until_s = VEP_NEXTTAG;
vep->state = VEP_UNTIL;
vep_mark_verbatim(vep, p);
break;
}
p++;
......@@ -943,9 +944,9 @@ VEP_parse(const struct sess *sp, const char *p, size_t l)
vep->state = vep->until_s;
break;
}
}
if (p == e && !vep->remove)
vep_mark_verbatim(vep, p);
}
} else {
Debug("*** Unknown state %s\n", vep->state);
INCOMPL();
......
# $Id$
test "Ticket #873"
server s1 {
rxreq
txresp -nolen -hdr "Transfer-encoding: chunked"
chunked {<!-- jfsljfslkjfslkfjsljflskjflskjdj -->}
chunked {<![CDATA[fooooooooooooooooooobar]]>}
chunkedlen 0
} -start
varnish v1 -vcl+backend {
sub vcl_fetch {
set beresp.do_esi = true;
set beresp.do_gzip = true;
}
} -start
client c1 {
txreq -hdr "Accept-Encoding: gzip"
rxresp
expect resp.http.content-encoding == gzip
gunzip
expect resp.status == 200
expect resp.bodylen == 75
} -run
varnish v1 -expect esi_errors == 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