gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [libmicrohttpd] branch master updated: Do not add "Connecti


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated: Do not add "Connection: Keep-Alive" header for "upgrade" connections
Date: Tue, 09 May 2017 22:18:10 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

The following commit(s) were added to refs/heads/master by this push:
     new 917342b3 Do not add "Connection: Keep-Alive" header for "upgrade" 
connections
917342b3 is described below

commit 917342b3fb0547523f2b4c6e607bb2ffd9cacdfd
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Tue May 9 23:17:57 2017 +0300

    Do not add "Connection: Keep-Alive" header for "upgrade" connections
---
 ChangeLog                   |  4 ++++
 src/microhttpd/connection.c | 11 +++++++++++
 2 files changed, 15 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index ed19ecc9..3d60111b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue May  9 23:16:00 MSK 2017
+       Fixed: Do not add "Connection: Keep-Alive" header for "upgrade"
+       connections. -EG
+
 Tue May  9 21:01:00 MSK 2017
        Fixed: check all "Connection" headers of request for "Close" and 
"Upgrade"
        tokens instead of using only first "Connection" header with full string
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 38d439ef..a987a97b 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -1148,11 +1148,19 @@ build_header_response (struct MHD_Connection 
*connection)
 
       if (0 != (connection->response->flags & MHD_RF_HTTP_VERSION_1_0_ONLY))
         connection->keepalive = MHD_CONN_MUST_CLOSE;
+#ifdef UPGRADE_SUPPORT
+      else if (NULL != connection->response->upgrade_handler)
+        /* If this connection will not be "upgraded", it must be closed. */
+        connection->keepalive = MHD_CONN_MUST_CLOSE;
+#endif /* UPGRADE_SUPPORT */
 
       /* now analyze chunked encoding situation */
       connection->have_chunked_upload = false;
 
       if ( (MHD_SIZE_UNKNOWN == connection->response->total_size) &&
+#ifdef UPGRADE_SUPPORT
+           (NULL == connection->response->upgrade_handler) &&
+#endif /* UPGRADE_SUPPORT */
            (! response_has_close) &&
            (! client_requested_close) )
         {
@@ -1244,6 +1252,9 @@ build_header_response (struct MHD_Connection *connection)
            (! response_has_close) &&
            (MHD_NO == must_add_close) &&
            (MHD_CONN_MUST_CLOSE != connection->keepalive) &&
+#ifdef UPGRADE_SUPPORT
+           (NULL == connection->response->upgrade_handler) &&
+#endif /* UPGRADE_SUPPORT */
            (MHD_YES == keepalive_possible (connection)) )
         must_add_keep_alive = MHD_YES;
       break;

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]