From: Fabian Keil Date: Wed, 21 Apr 2010 20:48:06 +0000 (+0000) Subject: In finish_http_response(), continue to add the 'Connection: close' header if the... X-Git-Tag: v_3_0_17~162 X-Git-Url: http://www.privoxy.org/gitweb/trouble.html?a=commitdiff_plain;h=dc0b08ab7bb1e3101ee62232e5c8bd965f2ddc40;p=privoxy.git In finish_http_response(), continue to add the 'Connection: close' header if the client connection will not be kept alive. Anonymously pointed out in #2987454. --- diff --git a/cgi.c b/cgi.c index 8f1807f0..758bb244 100644 --- a/cgi.c +++ b/cgi.c @@ -1,4 +1,4 @@ -const char cgi_rcs[] = "$Id: cgi.c,v 1.126 2009/10/29 16:53:56 fabiankeil Exp $"; +const char cgi_rcs[] = "$Id: cgi.c,v 1.127 2010/04/12 16:48:45 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgi.c,v $ @@ -1636,6 +1636,11 @@ struct http_response *finish_http_response(const struct client_state *csp, struc if (!err) err = enlist_unique_header(rsp->headers, "Pragma", "no-cache"); } + if (!err && !(csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE)) + { + err = enlist_unique_header(rsp->headers, "Connection", "close"); + } + /* * Write the head */