Commit 33e1b8ec authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Improve error messages for problems found during ESI parsing.

Split diagnostics into errors and warnings.  Warnings are
issued when the intent is clear and we can carry it out,
everything else is an error.

Collapse tag/endtag procssing, it's simpler.

Various code cleanups.




git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5750 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 42449d90
......@@ -130,6 +130,7 @@ esi_sendchunk(const struct sess *sp, const void *cb, ssize_t cl,
{
Debug("VER(%d) %d\n", (int)l, (int)(cb-ce));
assert(l > 0);
if (sp->wrk->res_mode & RES_CHUNKED)
(void)WRW_Write(sp->wrk, cb, cl);
(void)WRW_Write(sp->wrk, ptr, l);
......
This diff is collapsed.
......@@ -29,4 +29,4 @@ client c1 {
}
client c1 -run
varnish v1 -expect esi_errors == 1
varnish v1 -expect esi_errors == 2
......@@ -75,4 +75,4 @@ client c1 {
}
client c1 -run
varnish v1 -expect esi_errors == 14
varnish v1 -expect esi_errors == 15
......
# $Id$
test "Push corners in new ESI parser"
server s1 {
rxreq
txresp -body {
</esi:comment foo>
<esi:comment / >
<esi:remove foo="bar"></esi:remove>
<esi:include src="foo">
}
rxreq
expect req.url == "bar/foo"
txresp -body {<H1></H1>}
} -start
varnish v1 -vcl+backend {
sub vcl_fetch {
set beresp.do_esi = true;
}
} -start
varnish v1 -cliok "param.set esi_syntax 8"
varnish v1 -cliok "param.set diag_bitmap 0x10000"
client c1 {
txreq -url bar
rxresp
expect resp.status == 200
expect resp.bodylen == 23
} -run
varnish v1 -expect esi_errors == 2
varnish v1 -expect esi_warnings == 1
......@@ -237,7 +237,7 @@ start_test(void)
ALLOC_OBJ(jp, JOB_MAGIC);
AN(jp);
jp->bufsiz = 64*1024; /* XXX */
jp->bufsiz = 256*1024; /* XXX */
jp->buf = mmap(NULL, jp->bufsiz, PROT_READ|PROT_WRITE,
MAP_ANON | MAP_SHARED, -1, 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