]> err.no Git - varnish/commitdiff
The esi detector should also spot esi comments.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 3 Feb 2009 10:47:29 +0000 (10:47 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 3 Feb 2009 10:47:29 +0000 (10:47 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3567 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_vrt_esi.c

index 4fde71ee0879f2eef3cfbd678df211566cf2e564..4e1af4f09a89881f89b3868a243c2434be4f6d8b 100644 (file)
@@ -615,6 +615,8 @@ esi_parse(struct esi_work *ew)
 {
        char *p;
 
+printf("{%.*s}\n", Tlen(ew->t), ew->t.b);
+usleep(100000);
        if (params->esi_syntax & 0x4)
                VSL(SLT_Debug, ew->sp->fd, "Parse: %d <%.*s>",
                    Tlen(ew->t), Tlen(ew->t), ew->t.b);
@@ -662,21 +664,25 @@ static int
 contain_esi(struct object *obj) {
        struct storage *st;
        unsigned u;
-       const char *r;
+       const char *r, *r2;
        static const char *wanted = "<esi:";
+       static const char *wanted2 = "<!--esi";
 
        /*
         * Do a fast check to see if there is any '<esi:' sequences at all
         */
        r = wanted;
+       r2 = wanted2;
        VTAILQ_FOREACH(st, &obj->store, list) {
                AN(st);
                for (u = 0; u < st->len; u++) {
                        if (st->ptr[u] != *r) {
                                r = wanted;
-                               continue;
-                       }
-                       if (*++r == '\0')
+                       } else if (*++r == '\0')
+                               return (1);
+                       if (st->ptr[u] != *r2) {
+                               r2 = wanted2;
+                       } else if (*++r2 == '\0')
                                return (1);
                }
        }