gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] 01/02: MHD_queue_response(): ignore respons


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] 01/02: MHD_queue_response(): ignore response, but return OK if daemon is shut down. This will avoid race condition: if daemon is shutting down in parallel, response may be queued but aborted later. Therefore, returning "MHD_OK" will unify situation from application point of view.
Date: Mon, 30 Oct 2017 21:38:14 +0100

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit dc96775e3210bce764284d46be5fd889d63ef0b8
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Mon Oct 30 21:53:30 2017 +0300

    MHD_queue_response(): ignore response, but return OK if daemon is shut down.
    This will avoid race condition: if daemon is shutting down in parallel,
    response may be queued but aborted later.
    Therefore, returning "MHD_OK" will unify situation from application
    point of view.
---
 src/microhttpd/connection.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 9b040418..b19c67fa 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -3880,6 +3880,11 @@ MHD_queue_response (struct MHD_Connection *connection,
         (MHD_CONNECTION_FOOTERS_RECEIVED != connection->state) ) )
     return MHD_NO;
   daemon = connection->daemon;
+
+  if (daemon->shutdown)
+    return MHD_YES; /* If daemon was shut down in parallel,
+                     * response will be aborted now or on later stage. */
+
   if ( (!connection->suspended) &&
        (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) &&
        (!MHD_thread_ID_match_current_(connection->pid.ID)) )

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



reply via email to

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