]> err.no Git - varnish/commitdiff
Warn about XML/ESI language elements that are not properly closed.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 20 Nov 2007 21:01:00 +0000 (21:01 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 20 Nov 2007 21:01:00 +0000 (21:01 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2279 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_vrt_esi.c

index 2b73b0a6a3e3af5a09c40a89bb9c10620b6c016b..475d7c4dc593d70b8196769dc43facd8507c893b 100644 (file)
@@ -625,7 +625,12 @@ VRT_ESI(struct sess *sp)
                         * 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 @@ VRT_ESI(struct sess *sp)
                /* '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;