Commit 2923793f authored by Artur Bergman's avatar Artur Bergman

Move the setting of the correct headers for ESI from ESI parsing time to delivery time.

This is in anticipation for set req.esi = off;


git-svn-id: http://www.varnish-cache.org/svn/trunk@4049 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent a06de0a0
......@@ -739,13 +739,6 @@ ESI_Parse(struct sess *sp)
if (ew->incmt)
esi_error(ew, ew->t.e, -1,
"ESI 1.0 unterminated <!--esi comment");
/*
* Our ESI implementation needs chunked encoding
*/
http_Unset(sp->obj->http, H_Content_Length);
http_PrintfHeader(sp->wrk, sp->fd, sp->obj->http,
"Transfer-Encoding: chunked");
}
/*--------------------------------------------------------------------*/
......
......@@ -106,8 +106,11 @@ RES_BuildHttp(struct sess *sp)
HTTPH_A_DELIVER);
/* Only HTTP 1.1 can do Chunked encoding */
if (sp->http->protover < 1.1 && !VTAILQ_EMPTY(&sp->obj->esibits))
http_Unset(sp->wrk->resp, H_Transfer_Encoding);
if (!VTAILQ_EMPTY(&sp->obj->esibits)) {
http_Unset(sp->wrk->resp, H_Content_Length);
if(sp->http->protover >= 1.1)
http_PrintfHeader(sp->wrk, sp->fd, sp->wrk->resp, "Transfer-Encoding: chunked");
}
TIM_format(TIM_real(), time_str);
http_PrintfHeader(sp->wrk, sp->fd, sp->wrk->resp, "Date: %s", time_str);
......
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