]> err.no Git - varnish/commitdiff
Always generate a Connection: header, in case the client makes an incorrect
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 24 Jul 2007 13:54:20 +0000 (13:54 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 24 Jul 2007 13:54:20 +0000 (13:54 +0000)
assumption about which is the default.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1750 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_response.c

index e88d2138250fb99348bda044192808a225040cbc..69180607437cb2d9497f7f18b54a71f4a4f0415b 100644 (file)
@@ -76,8 +76,8 @@ res_do_304(struct sess *sp)
        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 @@ RES_BuildHttp(struct sess *sp)
        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");
 }
 
 /*--------------------------------------------------------------------*/