[PATCH] Honor remove-flag also when processing comments in ESI parsing.
Martin Blix Grydeland
martin at varnish-software.com
Tue Feb 14 15:04:52 CET 2012
Fixes: #1092
---
bin/varnishd/cache/cache_esi_parse.c | 1 -
bin/varnishtest/tests/r01092.vtc | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+), 1 deletions(-)
create mode 100644 bin/varnishtest/tests/r01092.vtc
diff --git a/bin/varnishd/cache/cache_esi_parse.c b/bin/varnishd/cache/cache_esi_parse.c
index 1d705b1..dcd2428 100644
--- a/bin/varnishd/cache/cache_esi_parse.c
+++ b/bin/varnishd/cache/cache_esi_parse.c
@@ -706,7 +706,6 @@ VEP_Parse(const struct worker *wrk, 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++;
diff --git a/bin/varnishtest/tests/r01092.vtc b/bin/varnishtest/tests/r01092.vtc
new file mode 100644
index 0000000..26b0b9c
--- /dev/null
+++ b/bin/varnishtest/tests/r01092.vtc
@@ -0,0 +1,34 @@
+varnishtest "Test case for #1092 - esi:remove and comments"
+
+server s1 {
+ rxreq
+ txresp -body {
+ <html>
+ Keep-1
+ <!--esX Keep-22 -->
+ <!--esi Keep-333 -->
+ <esi:remove>
+ Remove-1
+ <!-- Remove-22 -->
+ <!--esi Remove-333 -->
+ Remove-4444
+ </esi:remove>
+ Keep-4444
+ </html>
+ }
+} -start
+
+varnish v1 -vcl+backend {
+ sub vcl_fetch {
+ set beresp.do_esi = true;
+ }
+} -start -cliok "param.set esi_syntax 4"
+
+client c1 {
+ txreq
+ rxresp
+ expect resp.bodylen == 80
+}
+
+client c1 -run
+varnish v1 -expect esi_errors == 1
--
1.7.4.1
More information about the varnish-dev
mailing list