[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r35530 - in libmicrohttpd: . src/include src/microhttpd
From: |
gnunet |
Subject: |
[GNUnet-SVN] r35530 - in libmicrohttpd: . src/include src/microhttpd |
Date: |
Fri, 10 Apr 2015 22:05:40 +0200 |
Author: grothoff
Date: 2015-04-10 22:05:40 +0200 (Fri, 10 Apr 2015)
New Revision: 35530
Modified:
libmicrohttpd/ChangeLog
libmicrohttpd/src/include/microhttpd.h
libmicrohttpd/src/microhttpd/connection.c
Log:
The issue reported below is correct, the fix is not. The "!=" comparing the RF
flag should simply have been "==".
Louis wrote:
There is a change of behavior between 0.9.37 and 0.9.38.
When a client adds a "Connection: close" header in 0.9.37, MHD adds a
"Connection: close" header to its response and then
close the connection (as suggested in rfc2616, section 8.1.2.1).
The "Connection: close" header is not added in 0.9.38.
I looked into the 0.9.38 code and the code that prevents the inclusion of the
"Connection: close" header is at line 773 of connection.c.
if ( ( (NULL != client_requested_close) ||
(MHD_YES == connection->read_closed) ) &&
(NULL == response_has_close) &&
(0 != (connection->response->flags & MHD_RF_HTTP_VERSION_1_0_ONLY) ) )
must_add_close = MHD_YES;
Shouldn't it read
if ( ( (NULL != client_requested_close) ||
(MHD_YES == connection->read_closed) ||
(0 != (connection->response->flags & MHD_RF_HTTP_VERSION_1_0_ONLY) ) ) &&
(NULL == response_has_close) )
must_add_close = MHD_YES;
Thanks,
Louis Benoit
Modified: libmicrohttpd/ChangeLog
===================================================================
--- libmicrohttpd/ChangeLog 2015-04-10 17:02:04 UTC (rev 35529)
+++ libmicrohttpd/ChangeLog 2015-04-10 20:05:40 UTC (rev 35530)
@@ -1,3 +1,7 @@
+Fri Apr 10 22:02:27 CEST 2015
+ Fix logic to add "Connection: Close" that was broken in 0.9.38
+ when adding MHD_RF_HTTP_VERSION_1_0_ONLY. -CG
+
Fri Apr 10 00:38:40 CEST 2015
Ensure fast termination in MHD_USE_THREAD_PER_CONNECTION
mode on W32 by using signal pipe. -CG
Modified: libmicrohttpd/src/include/microhttpd.h
===================================================================
--- libmicrohttpd/src/include/microhttpd.h 2015-04-10 17:02:04 UTC (rev
35529)
+++ libmicrohttpd/src/include/microhttpd.h 2015-04-10 20:05:40 UTC (rev
35530)
@@ -130,7 +130,7 @@
* Current version of the library.
* 0x01093001 = 1.9.30-1.
*/
-#define MHD_VERSION 0x00094002
+#define MHD_VERSION 0x00094003
/**
* MHD-internal return code for "YES".
Modified: libmicrohttpd/src/microhttpd/connection.c
===================================================================
--- libmicrohttpd/src/microhttpd/connection.c 2015-04-10 17:02:04 UTC (rev
35529)
+++ libmicrohttpd/src/microhttpd/connection.c 2015-04-10 20:05:40 UTC (rev
35530)
@@ -775,7 +775,7 @@
if ( ( (NULL != client_requested_close) ||
(MHD_YES == connection->read_closed) ) &&
(NULL == response_has_close) &&
- (0 != (connection->response->flags & MHD_RF_HTTP_VERSION_1_0_ONLY)
) )
+ (0 == (connection->response->flags & MHD_RF_HTTP_VERSION_1_0_ONLY)
) )
must_add_close = MHD_YES;
/* check if we should add a 'content length' header */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r35530 - in libmicrohttpd: . src/include src/microhttpd,
gnunet <=