r1750 - trunk/varnish-cache/bin/varnishd
des at projects.linpro.no
des at projects.linpro.no
Tue Jul 24 15:54:21 CEST 2007
Author: des
Date: 2007-07-24 15:54:20 +0200 (Tue, 24 Jul 2007)
New Revision: 1750
Modified:
trunk/varnish-cache/bin/varnishd/cache_response.c
Log:
Always generate a Connection: header, in case the client makes an incorrect
assumption about which is the default.
Modified: trunk/varnish-cache/bin/varnishd/cache_response.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_response.c 2007-07-24 13:52:40 UTC (rev 1749)
+++ trunk/varnish-cache/bin/varnishd/cache_response.c 2007-07-24 13:54:20 UTC (rev 1750)
@@ -76,8 +76,8 @@
http_PrintfHeader(sp->wrk, sp->fd, sp->http, "X-Varnish: %u", sp->xid);
TIM_format(sp->obj->last_modified, lm);
http_PrintfHeader(sp->wrk, sp->fd, sp->http, "Last-Modified: %s", lm);
- if (sp->doclose != NULL)
- http_SetHeader(sp->wrk, sp->fd, sp->http, "Connection: close");
+ http_PrintfHeader(sp->wrk, sp->fd, sp->http, "Connection: %s",
+ sp->doclose ? "close" : "keep-alive");
sp->wantbody = 0;
}
@@ -129,8 +129,8 @@
http_PrintfHeader(sp->wrk, sp->fd, sp->http, "Age: %.0f",
sp->obj->age + sp->t_resp - sp->obj->entered);
http_SetHeader(sp->wrk, sp->fd, sp->http, "Via: 1.1 varnish");
- if (sp->doclose != NULL)
- http_SetHeader(sp->wrk, sp->fd, sp->http, "Connection: close");
+ http_PrintfHeader(sp->wrk, sp->fd, sp->http, "Connection: %s",
+ sp->doclose ? "close" : "keep-alive");
}
/*--------------------------------------------------------------------*/
More information about the varnish-commit
mailing list