gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] branch master updated (228df068 -> 1c167414


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated (228df068 -> 1c167414)
Date: Sat, 25 Feb 2017 19:24:55 +0100

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 228df068 Updated code to use new HTTP status codes
     new 5398d8ba Fixed connection states processing error introduced by 
813fc203ef95f7e3b1d410e182d363a30f5fdad3
     new 1c167414 test_get: really test ability to stop race

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/microhttpd/daemon.c | 10 +++++++++-
 src/testcurl/test_get.c |  3 +--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index f983e916..4a75b189 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -886,6 +886,7 @@ call_handlers (struct MHD_Connection *con,
                bool force_close)
 {
   int ret;
+  bool states_info_processed = false;
   /* Fast track flag */
   bool on_fasttrack = (con->state == MHD_CONNECTION_INIT);
 
@@ -899,6 +900,7 @@ call_handlers (struct MHD_Connection *con,
         {
           con->read_handler (con);
           ret = con->idle_handler (con);
+          states_info_processed = true;
         }
       /* No need to check value of 'ret' here as closed connection
        * cannot be in MHD_EVENT_LOOP_INFO_WRITE state. */
@@ -906,6 +908,7 @@ call_handlers (struct MHD_Connection *con,
         {
           con->write_handler (con);
           ret = con->idle_handler (con);
+          states_info_processed = true;
         }
     }
   else
@@ -915,6 +918,11 @@ call_handlers (struct MHD_Connection *con,
       return con->idle_handler (con);
     }
 
+  if (!states_info_processed)
+    { /* Connection is not read or write ready, but external conditions
+       * may be changed and need to be processed. */
+      ret = con->idle_handler (con);
+    }
   /* Fast track for fast connections. */
   /* If full request was read by single read_handler() invocation
      and headers were completely prepared by single idle_handler()
@@ -925,7 +933,7 @@ call_handlers (struct MHD_Connection *con,
      only for non-blocking sockets. */
   /* No need to check 'ret' as connection is always in
    * MHD_CONNECTION_CLOSED state if 'ret' is equal 'MHD_NO'. */
-  if (on_fasttrack && con->sk_nonblck)
+  else if (on_fasttrack && con->sk_nonblck)
     {
       if (MHD_CONNECTION_HEADERS_SENDING == con->state)
         {
diff --git a/src/testcurl/test_get.c b/src/testcurl/test_get.c
index 951db10e..dc8f9dc4 100644
--- a/src/testcurl/test_get.c
+++ b/src/testcurl/test_get.c
@@ -474,8 +474,7 @@ testStopRace (int poll_flag)
     struct MHD_Daemon *d;
 
     d = MHD_start_daemon (MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | poll_flag,
-                         1081, NULL, NULL, &ahc_echo, "GET",
-                         MHD_OPTION_CONNECTION_TIMEOUT, 5, MHD_OPTION_END);
+                         1081, NULL, NULL, &ahc_echo, "GET", MHD_OPTION_END);
     if (d == NULL)
        return 16;
 

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



reply via email to

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