Commit 2c7c0a79 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

The esi detector should also spot esi comments.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3567 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 2e5b8949
...@@ -615,6 +615,8 @@ esi_parse(struct esi_work *ew) ...@@ -615,6 +615,8 @@ esi_parse(struct esi_work *ew)
{ {
char *p; char *p;
printf("{%.*s}\n", Tlen(ew->t), ew->t.b);
usleep(100000);
if (params->esi_syntax & 0x4) if (params->esi_syntax & 0x4)
VSL(SLT_Debug, ew->sp->fd, "Parse: %d <%.*s>", VSL(SLT_Debug, ew->sp->fd, "Parse: %d <%.*s>",
Tlen(ew->t), Tlen(ew->t), ew->t.b); Tlen(ew->t), Tlen(ew->t), ew->t.b);
...@@ -662,21 +664,25 @@ static int ...@@ -662,21 +664,25 @@ static int
contain_esi(struct object *obj) { contain_esi(struct object *obj) {
struct storage *st; struct storage *st;
unsigned u; unsigned u;
const char *r; const char *r, *r2;
static const char *wanted = "<esi:"; static const char *wanted = "<esi:";
static const char *wanted2 = "<!--esi";
/* /*
* Do a fast check to see if there is any '<esi:' sequences at all * Do a fast check to see if there is any '<esi:' sequences at all
*/ */
r = wanted; r = wanted;
r2 = wanted2;
VTAILQ_FOREACH(st, &obj->store, list) { VTAILQ_FOREACH(st, &obj->store, list) {
AN(st); AN(st);
for (u = 0; u < st->len; u++) { for (u = 0; u < st->len; u++) {
if (st->ptr[u] != *r) { if (st->ptr[u] != *r) {
r = wanted; r = wanted;
continue; } else if (*++r == '\0')
} return (1);
if (*++r == '\0') if (st->ptr[u] != *r2) {
r2 = wanted2;
} else if (*++r2 == '\0')
return (1); return (1);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment