From: des Date: Tue, 24 Jul 2007 13:54:20 +0000 (+0000) Subject: Always generate a Connection: header, in case the client makes an incorrect X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82a3f06e545683e8705e1d77f84007beb992fe1c;p=varnish Always generate a Connection: header, in case the client makes an incorrect assumption about which is the default. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1750 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_response.c b/varnish-cache/bin/varnishd/cache_response.c index e88d2138..69180607 100644 --- a/varnish-cache/bin/varnishd/cache_response.c +++ b/varnish-cache/bin/varnishd/cache_response.c @@ -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"); } /*--------------------------------------------------------------------*/