gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r29392 - in libmicrohttpd: . src/microhttpd


From: gnunet
Subject: [GNUnet-SVN] r29392 - in libmicrohttpd: . src/microhttpd
Date: Wed, 18 Sep 2013 18:30:35 +0200

Author: grothoff
Date: 2013-09-18 18:30:35 +0200 (Wed, 18 Sep 2013)
New Revision: 29392

Modified:
   libmicrohttpd/ChangeLog
   libmicrohttpd/src/microhttpd/connection.c
Log:
signal non-error termination properly if stream was simply terminated by client

Modified: libmicrohttpd/ChangeLog
===================================================================
--- libmicrohttpd/ChangeLog     2013-09-18 16:27:12 UTC (rev 29391)
+++ libmicrohttpd/ChangeLog     2013-09-18 16:30:35 UTC (rev 29392)
@@ -1,3 +1,8 @@
+Wed Sep 18 18:29:24 CEST 2013
+       Signal connection termination as OK (and not as ERROR) if the
+       stream was terminated by the callback returning
+       MHD_CONTENT_READER_END_OF_STREAM. -CG
+
 Wed Sep 18 14:31:35 CEST 2013
        Adding #define MHD_HTTP_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN. -CG
 

Modified: libmicrohttpd/src/microhttpd/connection.c
===================================================================
--- libmicrohttpd/src/microhttpd/connection.c   2013-09-18 16:27:12 UTC (rev 
29391)
+++ libmicrohttpd/src/microhttpd/connection.c   2013-09-18 16:30:35 UTC (rev 
29392)
@@ -314,10 +314,10 @@
  * sending.  Assumes that the response mutex is
  * already held.  If the transmission is complete,
  * this function may close the socket (and return
- * MHD_NO).
+ * #MHD_NO).
  *
  * @param connection the connection
- * @return MHD_NO if readying the response failed
+ * @return #MHD_NO if readying the response failed
  */
 static int
 try_ready_normal_body (struct MHD_Connection *connection)
@@ -364,10 +364,11 @@
     {
       /* either error or http 1.0 transfer, close socket! */
       response->total_size = connection->response_write_position;
-      CONNECTION_CLOSE_ERROR (connection,
-                             (ret == MHD_CONTENT_READER_END_OF_STREAM) 
-                             ? "Closing connection (end of response)\n"
-                             : "Closing connection (stream error)\n");
+      if (MHD_CONTENT_READER_END_OF_STREAM == ret) 
+       MHD_connection_close (connection, MHD_REQUEST_TERMINATED_COMPLETD_OK);
+      else
+       CONNECTION_CLOSE_ERROR (connection,
+                               "Closing connection (stream error)\n");
       return MHD_NO;
     }
   response->data_start = connection->response_write_position;




reply via email to

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