Commit 5d8edbab authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

If we find no ESI elements of an object, don't penalize it with ESI's

chunked delivery.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2179 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 2412c2ef
...@@ -76,6 +76,7 @@ struct esi_work { ...@@ -76,6 +76,7 @@ struct esi_work {
struct esi_bit *eb; struct esi_bit *eb;
struct esi_bit *ebl; /* list of */ struct esi_bit *ebl; /* list of */
int neb; int neb;
int is_esi;
}; };
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
...@@ -361,6 +362,7 @@ esi_parse(struct esi_work *ew) ...@@ -361,6 +362,7 @@ esi_parse(struct esi_work *ew)
* first seven because the tail is handled * first seven because the tail is handled
* by the incmt flag. * by the incmt flag.
*/ */
ew->is_esi++;
if (i < 7) if (i < 7)
return (p - t.b); return (p - t.b);
...@@ -426,6 +428,8 @@ esi_parse(struct esi_work *ew) ...@@ -426,6 +428,8 @@ esi_parse(struct esi_work *ew)
if (r + 9 < q && !memcmp(r, "esi:remove", 10)) { if (r + 9 < q && !memcmp(r, "esi:remove", 10)) {
ew->is_esi++;
if (celem != remflg) { if (celem != remflg) {
/* /*
* ESI 1.0 violation, ignore element * ESI 1.0 violation, ignore element
...@@ -468,6 +472,8 @@ esi_parse(struct esi_work *ew) ...@@ -468,6 +472,8 @@ esi_parse(struct esi_work *ew)
if (r + 10 < q && !memcmp(r, "esi:include", 11)) { if (r + 10 < q && !memcmp(r, "esi:include", 11)) {
ew->is_esi++;
o.e = p; o.e = p;
esi_addverbatim(ew, o); esi_addverbatim(ew, o);
...@@ -547,11 +553,15 @@ VRT_ESI(struct sess *sp) ...@@ -547,11 +553,15 @@ VRT_ESI(struct sess *sp)
if (VTAILQ_NEXT(st, list)) if (VTAILQ_NEXT(st, list))
INCOMPL(); INCOMPL();
} }
i = Tlen(ew->dst);
} }
if (Tlen(ew->dst)) if (Tlen(ew->dst))
esi_addbit(ew); esi_addbit(ew);
if (!ew->is_esi) {
ESI_Destroy(sp->obj);
return;
}
/* /*
* Our ESI implementation needs chunked encoding * Our ESI implementation needs chunked encoding
* XXX: We should only do this if we find any ESI directives * XXX: We should only do this if we find any ESI directives
......
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