[master] a434ce4 Honor remove-flag also when processing comments in ESI parsing.

Martin Blix Grydeland martin at varnish-cache.org
Tue Feb 14 16:03:46 CET 2012


commit a434ce46a6362f1dc930d783982a8eda67cb99d6
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Tue Feb 14 15:02:32 2012 +0100

    Honor remove-flag also when processing comments in ESI parsing.
    
    Fixes: #1092

diff --git a/bin/varnishd/cache/cache_esi_parse.c b/bin/varnishd/cache/cache_esi_parse.c
index 433208d..8e9429c 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 busyobj *bo, 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



More information about the varnish-commit mailing list