From dc0b08ab7bb1e3101ee62232e5c8bd965f2ddc40 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Wed, 21 Apr 2010 20:48:06 +0000 Subject: [PATCH] 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. --- cgi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 */ -- 2.39.2