From: phk Date: Thu, 10 Jul 2008 20:49:45 +0000 (+0000) Subject: Fix two bugs in esi parsing: X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f12e553def56a82ddd76338929501d7fdaa149c;p=varnish Fix two bugs in esi parsing: Ignore unknown include attributes and Warn about src attributes without value git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2924 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_vrt_esi.c b/varnish-cache/bin/varnishd/cache_vrt_esi.c index e7897f0e..63908cea 100644 --- a/varnish-cache/bin/varnishd/cache_vrt_esi.c +++ b/varnish-cache/bin/varnishd/cache_vrt_esi.c @@ -277,10 +277,13 @@ esi_addinclude(struct esi_work *ew, txt t) VSL(SLT_Debug, 0, "<%.*s> -> <%.*s>", tag.e - tag.b, tag.b, val.e - val.b, val.b); - if (Tlen(tag) != 3 && memcmp(tag.b, "src", 3)) + if (Tlen(tag) != 3 || memcmp(tag.b, "src", 3)) + continue; + if (Tlen(val) == 0) { + esi_error(ew, tag.b, Tlen(tag), + "ESI esi:include src attribute withou value"); continue; - - assert(Tlen(val) > 0); /* XXX */ + } if (Tlen(val) > 7 && !memcmp(val.b, "http://", 7)) { /* Rewrite to Host: header inplace */