r3567 - trunk/varnish-cache/bin/varnishd
phk at projects.linpro.no
phk at projects.linpro.no
Tue Feb 3 11:47:29 CET 2009
Author: phk
Date: 2009-02-03 11:47:29 +0100 (Tue, 03 Feb 2009)
New Revision: 3567
Modified:
trunk/varnish-cache/bin/varnishd/cache_vrt_esi.c
Log:
The esi detector should also spot esi comments.
Modified: trunk/varnish-cache/bin/varnishd/cache_vrt_esi.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt_esi.c 2009-02-03 10:26:02 UTC (rev 3566)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt_esi.c 2009-02-03 10:47:29 UTC (rev 3567)
@@ -615,6 +615,8 @@
{
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,22 +664,26 @@
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);
}
}
return (0);
More information about the varnish-commit
mailing list