r2279 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Tue Nov 20 22:01:00 CET 2007


Author: phk
Date: 2007-11-20 22:01:00 +0100 (Tue, 20 Nov 2007)
New Revision: 2279

Modified:
   trunk/varnish-cache/bin/varnishd/cache_vrt_esi.c
Log:
Warn about XML/ESI language elements that are not properly closed.


Modified: trunk/varnish-cache/bin/varnishd/cache_vrt_esi.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt_esi.c	2007-11-20 20:41:19 UTC (rev 2278)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt_esi.c	2007-11-20 21:01:00 UTC (rev 2279)
@@ -625,7 +625,12 @@
 			 * XXX: all of it, or do we leave the final
 			 * XXX: element dangling ?
 			 */
-			INCOMPL();
+			esi_error(ew, p, ew->t.e -p,
+			    "XML 1.0 incomplete language element");
+			ew->dst.b = p;
+			ew->dst.e = ew->t.e;
+			esi_addbit(ew);
+			break;
 		}
 
 		/* Move remainder to workspace */
@@ -660,6 +665,13 @@
 		/* 'p' is cached starting point for next storage part */
 	}
 
+	if (ew->remflg)
+		esi_error(ew, NULL, 0,
+		    "ESI 1.0 unterminated <esi:remove> element");
+	if (ew->incmt)
+		esi_error(ew, NULL, 0,
+		    "ESI 1.0 unterminated <!--esi comment");
+
 	if (!ew->is_esi) {
 		ESI_Destroy(sp->obj);
 		return;




More information about the varnish-commit mailing list