In finish_http_response(), continue to add the 'Connection: close' header if the...
authorFabian Keil <fk@fabiankeil.de>
Wed, 21 Apr 2010 20:48:06 +0000 (20:48 +0000)
committerFabian Keil <fk@fabiankeil.de>
Wed, 21 Apr 2010 20:48:06 +0000 (20:48 +0000)
Anonymously pointed out in #2987454.

cgi.c

diff --git a/cgi.c b/cgi.c
index 8f1807f..758bb24 100644 (file)
--- 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
     */