gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] branch master updated (7f1dbb2a -> 0ebdff94


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated (7f1dbb2a -> 0ebdff94)
Date: Fri, 02 Mar 2018 21:45:30 +0100

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

grothoff pushed a change to branch master
in repository libmicrohttpd.

    from 7f1dbb2a postfix
     new 71a67ca9 remove dead IN_CLEANUP state, revert previous patch that 
called completed callback from wrong thread
     new 73532f78 minimal logic simplifications
     new 0ebdff94 fix test_upgrade transient failures (#5189)

The 3 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:
 ChangeLog                          |   4 ++
 src/lib/connection_add.c           |  31 +++++-------
 src/lib/connection_call_handlers.c |   6 ---
 src/lib/daemon_destroy.c           |  15 +++---
 src/lib/daemon_start.c             |  51 ++++++++++---------
 src/lib/internal.h                 | 101 ++++++++++++++++++-------------------
 src/lib/request_info.c             |   7 ++-
 src/lib/request_resume.c           |  10 +++-
 src/microhttpd/connection.c        |  50 ++++++++----------
 src/microhttpd/daemon.c            |  55 +++++++++++---------
 src/microhttpd/internal.h          |   5 --
 src/microhttpd/test_upgrade.c      | 100 ++++++++++++++++++++++++++----------
 12 files changed, 235 insertions(+), 200 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 214d6373..60463ce8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Fri Mar  2 21:44:24 CET 2018
+       Ensure MHD_RequestCompletedCallback is always called from
+       the correct thread (even on shutdown and for upgraded connections). -CG
+
 Tue Feb 27 23:27:02 CET 2018
        Ensure MHD_RequestCompletedCallback is also called for
        upgraded connections. -CG
diff --git a/src/lib/connection_add.c b/src/lib/connection_add.c
index 39a61f61..570a6a09 100644
--- a/src/lib/connection_add.c
+++ b/src/lib/connection_add.c
@@ -110,7 +110,7 @@ thread_main_handle_connection (void *data)
   const bool use_poll = false;
 #endif /* ! HAVE_POLL */
   bool was_suspended = false;
-  
+
   MHD_thread_init_(&con->pid);
 
   while ( (! daemon->shutdown) &&
@@ -398,7 +398,7 @@ thread_main_handle_connection (void *data)
         {
           /* Normal HTTP processing is finished,
            * notify application. */
-          if (NULL != con->request.response->termination_cb) 
+          if (NULL != con->request.response->termination_cb)
             con->request.response->termination_cb
              (con->request.response->termination_cb_cls,
               MHD_REQUEST_TERMINATED_COMPLETED_OK,
@@ -419,22 +419,19 @@ thread_main_handle_connection (void *data)
         }
 #endif /* UPGRADE_SUPPORT */
     }
-  if (MHD_REQUEST_IN_CLEANUP != con->request.state)
-    {
 #if DEBUG_CLOSE
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (con->daemon,
-               MHD_SC_THREAD_TERMINATING,
-                _("Processing thread terminating. Closing connection\n"));
+  MHD_DLOG (con->daemon,
+            MHD_SC_THREAD_TERMINATING,
+            _("Processing thread terminating. Closing connection\n"));
 #endif
 #endif
-      if (MHD_REQUEST_CLOSED != con->request.state)
-       MHD_connection_close_ (con,
-                               (daemon->shutdown) ?
-                               MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN:
-                               MHD_REQUEST_TERMINATED_WITH_ERROR);
-      MHD_request_handle_idle_ (&con->request);
-    }
+  if (MHD_REQUEST_CLOSED != con->request.state)
+    MHD_connection_close_ (con,
+                           (daemon->shutdown) ?
+                           MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN:
+                           MHD_REQUEST_TERMINATED_WITH_ERROR);
+  MHD_request_handle_idle_ (&con->request);
 exit:
   if (NULL != con->request.response)
     {
@@ -892,7 +889,7 @@ internal_add_connection (struct MHD_Daemon *daemon,
 #endif
     }
   return MHD_SC_OK;
-  
+
  cleanup:
   if (NULL != daemon->notify_connection_cb)
     daemon->notify_connection_cb (daemon->notify_connection_cb_cls,
@@ -908,7 +905,7 @@ internal_add_connection (struct MHD_Daemon *daemon,
                     addr,
                     addrlen);
   MHD_mutex_lock_chk_ (&daemon->cleanup_connection_mutex);
-  if (MHD_TM_THREAD_PER_CONNECTION != daemon->threading_model) 
+  if (MHD_TM_THREAD_PER_CONNECTION != daemon->threading_model)
     {
       XDLL_remove (daemon->normal_timeout_head,
                    daemon->normal_timeout_tail,
@@ -976,7 +973,7 @@ MHD_daemon_add_connection (struct MHD_Daemon *daemon,
     {
       sk_nonbl = true;
     }
-  
+
   if ( (daemon->enable_turbo) &&
        (! MHD_socket_noninheritable_ (client_socket)) )
     {
diff --git a/src/lib/connection_call_handlers.c 
b/src/lib/connection_call_handlers.c
index 22704d1b..f1c31cb6 100644
--- a/src/lib/connection_call_handlers.c
+++ b/src/lib/connection_call_handlers.c
@@ -971,9 +971,6 @@ MHD_request_handle_write_ (struct MHD_Request *request)
       return;
     case MHD_REQUEST_CLOSED:
       return;
-    case MHD_REQUEST_IN_CLEANUP:
-      mhd_assert (0);
-      return;
 #ifdef UPGRADE_SUPPORT
     case MHD_REQUEST_UPGRADE:
       mhd_assert (0);
@@ -3048,9 +3045,6 @@ connection_update_event_loop_info (struct MHD_Connection 
*connection)
         case MHD_REQUEST_CLOSED:
          request->event_loop_info = MHD_EVENT_LOOP_INFO_CLEANUP;
           return;       /* do nothing, not even reading */
-        case MHD_REQUEST_IN_CLEANUP:
-          mhd_assert (0);
-          break;
 #ifdef UPGRADE_SUPPORT
         case MHD_REQUEST_UPGRADE:
           mhd_assert (0);
diff --git a/src/lib/daemon_destroy.c b/src/lib/daemon_destroy.c
index a236ba8f..ae8c33d8 100644
--- a/src/lib/daemon_destroy.c
+++ b/src/lib/daemon_destroy.c
@@ -37,7 +37,7 @@ stop_workers (struct MHD_Daemon *daemon)
 {
   MHD_socket fd;
   unsigned int i;
-       
+
   mhd_assert (1 < daemon->worker_pool_size);
   mhd_assert (1 < daemon->threading_model);
   if (daemon->was_quiesced)
@@ -102,7 +102,7 @@ MHD_daemon_destroy (struct MHD_Daemon *daemon)
     fd = daemon->listen_socket;
 
   /* FIXME: convert from here to microhttpd2-style API! */
-  
+
   if (NULL != daemon->worker_pool)
     { /* Master daemon with worker pool. */
       stop_workers (daemon);
@@ -114,9 +114,6 @@ MHD_daemon_destroy (struct MHD_Daemon *daemon)
       if (MHD_TM_EXTERNAL_EVENT_LOOP != daemon->threading_model)
         {
          /* Worker daemon or single daemon with internal thread(s). */
-          if (! daemon->disallow_suspend_resume)
-            (void) MHD_resume_suspended_connections_ (daemon);
-
          /* Separate thread(s) is used for polling sockets. */
          if (MHD_ITC_IS_VALID_(daemon->itc))
            {
@@ -137,7 +134,7 @@ MHD_daemon_destroy (struct MHD_Daemon *daemon)
 #endif /* HAVE_LISTEN_SHUTDOWN */
                mhd_assert (false); /* Should never happen */
            }
-         
+
          if (! MHD_join_thread_ (daemon->pid.handle))
            {
              MHD_PANIC (_("Failed to join a thread\n"));
@@ -171,10 +168,10 @@ MHD_daemon_destroy (struct MHD_Daemon *daemon)
     return;
   /* Cleanup that should be done only one time in master/single daemon.
    * Do not perform this cleanup in worker daemons. */
-      
+
   if (MHD_INVALID_SOCKET != fd)
     MHD_socket_close_chk_ (fd);
-  
+
   /* TLS clean up */
 #ifdef HTTPS_SUPPORT
   if (NULL != daemon->tls_api)
@@ -191,7 +188,7 @@ MHD_daemon_destroy (struct MHD_Daemon *daemon)
 #endif
     }
 #endif /* HTTPS_SUPPORT */
-  
+
 #ifdef DAUTH_SUPPORT
   free (daemon->nnc);
   MHD_mutex_destroy_chk_ (&daemon->nnc_lock);
diff --git a/src/lib/daemon_start.c b/src/lib/daemon_start.c
index a3099d75..4705851d 100644
--- a/src/lib/daemon_start.c
+++ b/src/lib/daemon_start.c
@@ -28,6 +28,7 @@
 #include "daemon_select.h"
 #include "daemon_poll.h"
 #include "daemon_epoll.h"
+#include "request_resume.h"
 
 
 /**
@@ -159,7 +160,7 @@ open_listen_socket (struct MHD_Daemon *daemon)
   const struct sockaddr *sa;
   int pf;
   bool use_v6;
-      
+
   if (MHD_INVALID_SOCKET != daemon->listen_socket)
     return MHD_SC_OK; /* application opened it for us! */
 
@@ -223,7 +224,7 @@ open_listen_socket (struct MHD_Daemon *daemon)
       return MHD_SC_IPV6_NOT_SUPPORTED_BY_BUILD;
 #endif
     }
-  
+
   /* try to open listen socket */
  try_open_listen_socket:
   daemon->listen_socket = MHD_socket_create_listen_(pf);
@@ -235,7 +236,7 @@ open_listen_socket (struct MHD_Daemon *daemon)
       pf = PF_INET;
       goto try_open_listen_socket;
     }
-  if (MHD_INVALID_SOCKET == daemon->listen_socket) 
+  if (MHD_INVALID_SOCKET == daemon->listen_socket)
     {
 #ifdef HAVE_MESSAGES
       MHD_DLOG (daemon,
@@ -281,7 +282,7 @@ open_listen_socket (struct MHD_Daemon *daemon)
 #endif
 #endif
     }
-  
+
   /* Determine address to bind to */
   if (0 != daemon->listen_sa_len)
     {
@@ -332,8 +333,8 @@ open_listen_socket (struct MHD_Daemon *daemon)
        }
       sa = (const struct sockaddr *) &ss;
     }
-      
-  /* actually do the bind() */    
+
+  /* actually do the bind() */
   if (-1 == bind (daemon->listen_socket,
                  sa,
                  addrlen))
@@ -406,7 +407,7 @@ open_listen_socket (struct MHD_Daemon *daemon)
 }
 
 
-/** 
+/**
  * Obtain the listen port number from the socket (if it
  * was not explicitly set by us, i.e. if we were given
  * a listen socket or if the port was 0 and the OS picked
@@ -419,7 +420,7 @@ get_listen_port_number (struct MHD_Daemon *daemon)
 {
   struct sockaddr_storage servaddr;
   socklen_t addrlen;
-  
+
   if ( (0 != daemon->listen_port) ||
        (MHD_INVALID_SOCKET == daemon->listen_socket) )
     return; /* nothing to be done */
@@ -457,7 +458,7 @@ get_listen_port_number (struct MHD_Daemon *daemon)
     case AF_INET:
       {
        struct sockaddr_in *s4 = (struct sockaddr_in *) &servaddr;
-       
+
        daemon->listen_port = ntohs (s4->sin_port);
        break;
       }
@@ -465,7 +466,7 @@ get_listen_port_number (struct MHD_Daemon *daemon)
     case AF_INET6:
       {
        struct sockaddr_in6 *s6 = (struct sockaddr_in6 *) &servaddr;
-       
+
        daemon->listen_port = ntohs(s6->sin6_port);
        break;
       }
@@ -630,7 +631,7 @@ MHD_polling_thread (void *cls)
                          MHD_YES);
        break;
       case MHD_ELS_EPOLL:
-#ifdef EPOLL_SUPPORT   
+#ifdef EPOLL_SUPPORT
        MHD_daemon_epoll_ (daemon,
                           MHD_YES);
 #else
@@ -643,6 +644,8 @@ MHD_polling_thread (void *cls)
   /* Resume any pending for resume connections, join
    * all connection's threads (if any) and finally cleanup
    * everything. */
+  if (! daemon->disallow_suspend_resume)
+    MHD_resume_suspended_connections_ (daemon);
   MHD_daemon_close_all_connections_ (daemon);
 
   return (MHD_THRD_RTRN_TYPE_)0;
@@ -673,13 +676,13 @@ setup_thread_pool (struct MHD_Daemon *daemon)
                                     sizeof (struct MHD_Daemon));
   if (NULL == daemon->worker_pool)
     return MHD_SC_THREAD_POOL_MALLOC_FAILURE;
-  
+
   /* Start the workers in the pool */
   for (i = 0; i < daemon->threading_model; i++)
     {
       /* Create copy of the Daemon object for each worker */
       struct MHD_Daemon *d = &daemon->worker_pool[i];
-      
+
       memcpy (d,
              daemon,
              sizeof (struct MHD_Daemon));
@@ -695,8 +698,8 @@ setup_thread_pool (struct MHD_Daemon *daemon)
       d->global_connection_limit = conns_per_thread;
       if (((unsigned int) i) < leftover_conns)
        ++d->global_connection_limit;
-         
-      if (! daemon->disable_itc)       
+
+      if (! daemon->disable_itc)
        {
          if (! MHD_itc_init_ (d->itc))
            {
@@ -727,13 +730,13 @@ setup_thread_pool (struct MHD_Daemon *daemon)
        {
          MHD_itc_set_invalid_ (d->itc);
        }
-      
+
 #ifdef EPOLL_SUPPORT
       if ( (MHD_ELS_EPOLL == daemon->event_loop_syscall) &&
           (MHD_SC_OK != (sc = setup_epoll_to_listen (d))) )
        goto thread_failed;
 #endif
-      
+
       /* Must init cleanup connection mutex for each worker */
       if (! MHD_mutex_init_ (&d->cleanup_connection_mutex))
        {
@@ -747,7 +750,7 @@ setup_thread_pool (struct MHD_Daemon *daemon)
          sc = MHD_SC_THREAD_POOL_CREATE_MUTEX_FAILURE;
          goto thread_failed;
        }
-      
+
       /* Spawn the worker thread */
       if (! MHD_create_named_thread_ (&d->pid,
                                      "MHD-worker",
@@ -867,10 +870,10 @@ MHD_daemon_start (struct MHD_Daemon *daemon)
          return MHD_SC_ITC_DESCRIPTOR_TOO_LARGE;
        }
     }
-  
+
   if (MHD_SC_OK != (sc = open_listen_socket (daemon)))
     return sc;
-  
+
   /* Check listen socket is in range (if we are limited) */
   if ( (MHD_INVALID_SOCKET != daemon->listen_socket) &&
        (MHD_ELS_SELECT == daemon->event_loop_syscall) &&
@@ -886,7 +889,7 @@ MHD_daemon_start (struct MHD_Daemon *daemon)
 #endif
       return MHD_SC_LISTEN_SOCKET_TOO_LARGE;
     }
-  
+
   /* set listen socket to non-blocking */
   if ( (MHD_INVALID_SOCKET != daemon->listen_socket) &&
        (! MHD_socket_nonblocking_ (daemon->listen_socket)) )
@@ -907,7 +910,7 @@ MHD_daemon_start (struct MHD_Daemon *daemon)
          return MHD_SC_LISTEN_SOCKET_NONBLOCKING_FAILURE;
        }
     }
-  
+
 #ifdef EPOLL_SUPPORT
   /* Setup epoll */
   if ( (MHD_ELS_EPOLL == daemon->event_loop_syscall) &&
@@ -916,7 +919,7 @@ MHD_daemon_start (struct MHD_Daemon *daemon)
        (MHD_SC_OK != (sc = setup_epoll_to_listen (daemon))) )
     return sc;
 #endif
-     
+
   /* Setup main listen thread (only if we have no thread pool or
      external event loop and do have a listen socket) */
   /* FIXME: why no worker thread if we have no listen socket? */
@@ -949,7 +952,7 @@ MHD_daemon_start (struct MHD_Daemon *daemon)
 
   /* make sure we know our listen port (if any) */
   get_listen_port_number (daemon);
-  
+
   return MHD_SC_OK;
 }
 
diff --git a/src/lib/internal.h b/src/lib/internal.h
index 52be90d9..97024683 100644
--- a/src/lib/internal.h
+++ b/src/lib/internal.h
@@ -209,7 +209,7 @@ typedef ssize_t
  * not have to be completed yet).  A transition to
  * #MHD_REQUEST_CLOSED or #MHD_REQUEST_INIT requires the write
  * to be complete.
- */ 
+ */
 enum MHD_REQUEST_STATE // FIXME: fix capitalization!
 {
   /**
@@ -317,11 +317,6 @@ enum MHD_REQUEST_STATE // FIXME: fix capitalization!
    */
   MHD_REQUEST_CLOSED = MHD_REQUEST_FOOTERS_SENT + 1,
 
-  /**
-   * 20: This request is finished (only to be freed)
-   */
-  MHD_REQUEST_IN_CLEANUP = MHD_REQUEST_CLOSED + 1,
-
 #ifdef UPGRADE_SUPPORT
   /**
    * Request was "upgraded" and socket is now under the
@@ -369,7 +364,7 @@ struct MHD_Request
 {
 
   /**
-   * Reference to the `struct MHD_Daemon`.  
+   * Reference to the `struct MHD_Daemon`.
    */
   struct MHD_Daemon *daemon;
 
@@ -383,7 +378,7 @@ struct MHD_Request
    * it is available.
    */
   struct MHD_Response *response;
-  
+
   /**
    * Linked list of parsed headers.
    */
@@ -554,7 +549,7 @@ struct MHD_Request
    * HTTP method, as an enum.
    */
   enum MHD_Method method;
-  
+
   /**
    * What is this request waiting for?
    */
@@ -633,7 +628,7 @@ enum MHD_EpollState
 
 /**
  * State kept per HTTP connection.
- */ 
+ */
 struct MHD_Connection
 {
 
@@ -687,7 +682,7 @@ struct MHD_Connection
    * address (which persists across individual requests).
    */
   struct MemoryPool *pool;
-  
+
   /**
    * We allow the main application to associate some pointer with the
    * TCP connection (which may span multiple HTTP requests).  Here is
@@ -703,7 +698,7 @@ struct MHD_Connection
    */
   struct MHD_TLS_ConnectionState *tls_cs;
 #endif
-  
+
   /**
    * Function used for reading HTTP request stream.
    */
@@ -727,7 +722,7 @@ struct MHD_Connection
   MHD_thread_handle_ID_ pid;
 
   /**
-   * Foreign address (of length @e addr_len). 
+   * Foreign address (of length @e addr_len).
    */
   struct sockaddr_storage addr;
 
@@ -794,7 +789,7 @@ struct MHD_Connection
    * from this socket).
    */
   bool read_closed;
-  
+
 };
 
 
@@ -1013,7 +1008,7 @@ struct MHD_Daemon
    */
   void *rc_cls;
 
-  /** 
+  /**
    * Function to call for logging.
    */
   MHD_LoggingCallback logger;
@@ -1021,7 +1016,7 @@ struct MHD_Daemon
   /**
    * Closure for @e logger.
    */
-  void *logger_cls;  
+  void *logger_cls;
 
   /**
    * Function to call to accept/reject connections based on
@@ -1076,7 +1071,7 @@ struct MHD_Daemon
    */
   struct MHD_Daemon *worker_pool;
 
-  
+
 #if HTTPS_SUPPORT
 #ifdef UPGRADE_SUPPORT
   /**
@@ -1098,7 +1093,7 @@ struct MHD_Daemon
    * Which TLS backend should be used. NULL for no TLS.
    * This is merely the handle to the dlsym() object, not
    * the API.
-   */ 
+   */
   void *tls_backend_lib;
 
   /**
@@ -1152,7 +1147,7 @@ struct MHD_Daemon
    * Not used in MHD_USE_THREAD_PER_CONNECTION mode.
    */
   struct MHD_Connection *manual_timeout_tail;
-  
+
   /**
    * Head of doubly-linked list of our current, active connections.
    */
@@ -1251,8 +1246,8 @@ struct MHD_Daemon
    * The select thread handle (if we have internal select)
    */
   MHD_thread_handle_ID_ pid;
-  
-  /** 
+
+  /**
    * Socket address to bind to for the listen socket.
    */
   struct sockaddr_storage listen_sa;
@@ -1267,8 +1262,8 @@ struct MHD_Daemon
    * "manual_timeout" DLLs.
    */
   MHD_mutex_ cleanup_connection_mutex;
-  
-  /** 
+
+  /**
    * Number of (valid) bytes in @e listen_sa.  Zero
    * if @e listen_sa is not initialized.
    */
@@ -1277,7 +1272,7 @@ struct MHD_Daemon
 /**
  * Default size of the per-connection memory pool.
  */
-#define POOL_SIZE_DEFAULT (32 * 1024) 
+#define POOL_SIZE_DEFAULT (32 * 1024)
   /**
    * Buffer size to use for each connection. Default
    * is #POOL_SIZE_DEFAULT.
@@ -1292,7 +1287,7 @@ struct MHD_Daemon
  * space).
  */
 #define BUF_INC_SIZE_DEFAULT 1024
-  
+
   /**
    * Increment to use when growing the read buffer. Smaller
    * than @e connection_memory_limit_b.
@@ -1306,7 +1301,7 @@ struct MHD_Daemon
   size_t thread_stack_limit_b;
 
 #if ENABLE_DAUTH
-  
+
   /**
    * Size of @e digest_auth_random_buf.
    */
@@ -1316,14 +1311,14 @@ struct MHD_Daemon
    * Default value for @e digest_nc_length.
    */
 #define DIGEST_NC_LENGTH_DEFAULT 4
-  
+
   /**
    * Desired length of the internal array with the nonce and
    * nonce counters for digest authentication.
    */
   size_t digest_nc_length;
 #endif
-  
+
   /**
    * Default value we use for the listen backlog.
    */
@@ -1332,13 +1327,13 @@ struct MHD_Daemon
 #else  /* !SOMAXCONN */
 #define LISTEN_BACKLOG_DEFAULT 511
 #endif
-  
+
   /**
-   * Backlog argument to use for listen.  See 
+   * Backlog argument to use for listen.  See
    * #MHD_daemon_listen_backlog().
    */
   int listen_backlog;
-  
+
   /**
    * Default queue length to use with fast open.
    */
@@ -1373,8 +1368,8 @@ struct MHD_Daemon
    * Default timeout in seconds for idle connections.
    */
   time_t connection_default_timeout;
-  
-  /** 
+
+  /**
    * Listen socket we should use, MHD_INVALID_SOCKET means
    * we are to initialize the socket from the other options given.
    */
@@ -1407,23 +1402,23 @@ struct MHD_Daemon
 #endif /* HTTPS_SUPPORT && UPGRADE_SUPPORT */
 
 #endif
-  
+
   /**
    * Inter-thread communication channel.
    */
   struct MHD_itc_ itc;
-  
+
   /**
    * Which threading model do we use? Postive
    * numbers indicate the number of worker threads to be used.
    * Values larger than 1 imply a thread pool.
    */
   enum MHD_ThreadingModel threading_model;
-  
+
   /**
-   * When should we use TCP_FASTOPEN? 
+   * When should we use TCP_FASTOPEN?
    * See #MHD_daemon_tcp_fastopen().
-   */ 
+   */
   enum MHD_FastOpenMethod fast_open_method;
 
   /**
@@ -1445,36 +1440,36 @@ struct MHD_Daemon
    */
   enum MHD_ProtocolStrictLevel protocol_strict_level;
 
-  /** 
+  /**
    * On which port should we listen on? Only effective if we were not
    * given a listen socket or a full address via
    * #MHD_daemon_bind_sa().  0 means to bind to random free port.
    */
   uint16_t listen_port;
-  
+
   /**
    * Suppress generating the "Date:" header, this system
    * lacks an RTC (or developer is hyper-optimizing).  See
    * #MHD_daemon_suppress_date_no_clock().
-   */ 
+   */
   bool suppress_date;
 
   /**
    * The use of the inter-thread communication channel is disabled.
    * See #MHD_daemon_disable_itc().
-   */ 
+   */
   bool disable_itc;
 
   /**
    * Disable #MHD_action_suspend() functionality.  See
    * #MHD_daemon_disallow_suspend_resume().
-   */ 
+   */
   bool disallow_suspend_resume;
 
   /**
    * Disable #MHD_action_upgrade() functionality.  See
    * #MHD_daemon_disallow_upgrade().
-   */ 
+   */
   bool disallow_upgrade;
 
   /**
@@ -1523,12 +1518,12 @@ struct MHD_Daemon
    * MHD should speak SHOUTcast instead of HTTP.
    */
   bool enable_shoutcast;
-  
+
   /**
    * Are we shutting down?
    */
   volatile bool shutdown;
-  
+
 };
 
 
@@ -1559,9 +1554,9 @@ struct MHD_Action
 
   /**
    * Closure for @a action
-   */ 
+   */
   void *action_cls;
-  
+
 };
 
 
@@ -1577,7 +1572,7 @@ struct MHD_Response
    * must be the first field in a response!
    */
   struct MHD_Action action;
-  
+
   /**
    * Headers to send for the response.  Initially
    * the linked list is created in inverse order;
@@ -1610,7 +1605,7 @@ struct MHD_Response
   MHD_ContentReaderFreeCallback crfc;
 
   /**
-   * Function to call once MHD is finished with 
+   * Function to call once MHD is finished with
    * the request, may be NULL.
    */
   MHD_RequestTerminationCallback termination_cb;
@@ -1619,7 +1614,7 @@ struct MHD_Response
    * Closure for @e termination_cb.
    */
   void *termination_cb_cls;
-  
+
 #ifdef UPGRADE_SUPPORT
   /**
    * Application function to call once we are done sending the headers
@@ -1671,7 +1666,7 @@ struct MHD_Response
    * HTTP status code of the response.
    */
   enum MHD_HTTP_StatusCode status_code;
-  
+
   /**
    * Reference count for this response.  Free once the counter hits
    * zero.
@@ -1692,7 +1687,7 @@ struct MHD_Response
    * Use ShoutCAST format.
    */
   bool icy;
-  
+
 };
 
 
diff --git a/src/lib/request_info.c b/src/lib/request_info.c
index a7342e0a..5f481d98 100644
--- a/src/lib/request_info.c
+++ b/src/lib/request_info.c
@@ -48,7 +48,7 @@ MHD_request_get_information_sz (struct MHD_Request *request,
 {
 #define CHECK_SIZE(type) if (sizeof(type) < return_value_size) \
     return MHD_NO
-  
+
   switch (info_type)
   {
   case MHD_REQUEST_INFORMATION_CONNECTION:
@@ -70,8 +70,7 @@ MHD_request_get_information_sz (struct MHD_Request *request,
   case MHD_REQUEST_INFORMATION_HEADER_SIZE:
     CHECK_SIZE (size_t);
     if ( (MHD_REQUEST_HEADERS_RECEIVED > request->state) ||
-        (MHD_REQUEST_CLOSED == request->state) ||
-           (MHD_REQUEST_IN_CLEANUP == request->state) )
+        (MHD_REQUEST_CLOSED == request->state) )
         return MHD_NO; /* invalid, too early! */
     return_value->header_size = request->header_size;
     return MHD_YES;
@@ -79,7 +78,7 @@ MHD_request_get_information_sz (struct MHD_Request *request,
   default:
     return MHD_NO;
   }
-  
+
 #undef CHECK_SIZE
 }
 
diff --git a/src/lib/request_resume.c b/src/lib/request_resume.c
index 5742f6ac..8fdffb87 100644
--- a/src/lib/request_resume.c
+++ b/src/lib/request_resume.c
@@ -156,11 +156,17 @@ MHD_resume_suspended_connections_ (struct MHD_Daemon 
*daemon)
 #ifdef UPGRADE_SUPPORT
       else
         {
+          struct MHD_Response *response = pos->request.response;
+
           /* Data forwarding was finished (for TLS connections) AND
            * application was closed upgraded connection.
            * Insert connection into cleanup list. */
-          MHD_connection_close_ (pos,
-                                 MHD_CONNECTION_NOTIFY_CLOSED);
+          if ( (NULL != response) &&
+               (MHD_TM_THREAD_PER_CONNECTION != daemon->threading_model) &&
+               (NULL != response->termination_cb) )
+            response->termination_cb (response->termination_cb_cls,
+                                      MHD_REQUEST_TERMINATED_COMPLETED_OK,
+                                      &pos->request.client_context);
           DLL_insert (daemon->cleanup_head,
                       daemon->cleanup_tail,
                       pos);
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 691aa427..66e9b394 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -1948,9 +1948,6 @@ MHD_connection_update_event_loop_info (struct 
MHD_Connection *connection)
         case MHD_CONNECTION_CLOSED:
          connection->event_loop_info = MHD_EVENT_LOOP_INFO_CLEANUP;
           return;       /* do nothing, not even reading */
-        case MHD_CONNECTION_IN_CLEANUP:
-          mhd_assert (0);
-          break;
 #ifdef UPGRADE_SUPPORT
         case MHD_CONNECTION_UPGRADE:
           mhd_assert (0);
@@ -2287,6 +2284,7 @@ parse_initial_message_line (struct MHD_Connection 
*connection,
 static void
 call_connection_handler (struct MHD_Connection *connection)
 {
+  struct MHD_Daemon *daemon = connection->daemon;
   size_t processed;
 
   if (NULL != connection->response)
@@ -2294,14 +2292,14 @@ call_connection_handler (struct MHD_Connection 
*connection)
   processed = 0;
   connection->client_aware = true;
   if (MHD_NO ==
-      connection->daemon->default_handler 
(connection->daemon->default_handler_cls,
-                                          connection,
-                                           connection->url,
-                                          connection->method,
-                                          connection->version,
-                                          NULL,
-                                           &processed,
-                                          &connection->client_context))
+      daemon->default_handler (daemon->default_handler_cls,
+                               connection,
+                               connection->url,
+                               connection->method,
+                               connection->version,
+                               NULL,
+                               &processed,
+                               &connection->client_context))
     {
       /* serious internal error, close connection */
       CONNECTION_CLOSE_ERROR (connection,
@@ -2321,6 +2319,7 @@ call_connection_handler (struct MHD_Connection 
*connection)
 static void
 process_request_body (struct MHD_Connection *connection)
 {
+  struct MHD_Daemon *daemon = connection->daemon;
   size_t available;
   int instant_retry;
   char *buffer_head;
@@ -2478,14 +2477,14 @@ process_request_body (struct MHD_Connection *connection)
       left_unprocessed = to_be_processed;
       connection->client_aware = true;
       if (MHD_NO ==
-          connection->daemon->default_handler 
(connection->daemon->default_handler_cls,
-                                               connection,
-                                               connection->url,
-                                               connection->method,
-                                               connection->version,
-                                               buffer_head,
-                                               &left_unprocessed,
-                                               &connection->client_context))
+          daemon->default_handler (daemon->default_handler_cls,
+                                   connection,
+                                   connection->url,
+                                   connection->method,
+                                   connection->version,
+                                   buffer_head,
+                                   &left_unprocessed,
+                                   &connection->client_context))
         {
           /* serious internal error, close connection */
           CONNECTION_CLOSE_ERROR (connection,
@@ -2509,9 +2508,9 @@ process_request_body (struct MHD_Connection *connection)
          /* client did not process all upload data, complain if
             the setup was incorrect, which may prevent us from
             handling the rest of the request */
-         if ( (0 != (connection->daemon->options & 
MHD_USE_INTERNAL_POLLING_THREAD)) &&
+         if ( (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) &&
               (! connection->suspended) )
-           MHD_DLOG (connection->daemon,
+           MHD_DLOG (daemon,
                      _("WARNING: incomplete upload processing and connection 
not suspended may result in hung connection.\n"));
 #endif
        }
@@ -3151,9 +3150,6 @@ MHD_connection_handle_write (struct MHD_Connection 
*connection)
       return;
     case MHD_CONNECTION_CLOSED:
       return;
-    case MHD_CONNECTION_IN_CLEANUP:
-      mhd_assert (0);
-      return;
 #ifdef UPGRADE_SUPPORT
     case MHD_CONNECTION_UPGRADE:
       mhd_assert (0);
@@ -3648,12 +3644,12 @@ MHD_connection_handle_idle (struct MHD_Connection 
*connection)
           if ( (NULL != daemon->notify_completed) &&
                (connection->client_aware) )
           {
-            connection->client_aware = false;
            daemon->notify_completed (daemon->notify_completed_cls,
                                      connection,
                                      &connection->client_context,
                                      MHD_REQUEST_TERMINATED_COMPLETED_OK);
           }
+          connection->client_aware = false;
           if ( (MHD_CONN_USE_KEEPALIVE != connection->keepalive) ||
                (connection->read_closed) )
             {
@@ -3687,7 +3683,6 @@ MHD_connection_handle_idle (struct MHD_Connection 
*connection)
               connection->read_buffer_size
                 = connection->daemon->pool_size / 2;
             }
-         connection->client_aware = false;
           connection->client_context = NULL;
           connection->continue_message_write_offset = 0;
           connection->responseCode = 0;
@@ -3857,8 +3852,7 @@ MHD_get_connection_info (struct MHD_Connection 
*connection,
       return (const union MHD_ConnectionInfo *) 
&connection->connection_timeout_dummy;
     case MHD_CONNECTION_INFO_REQUEST_HEADER_SIZE:
       if ( (MHD_CONNECTION_HEADERS_RECEIVED > connection->state) ||
-           (MHD_CONNECTION_CLOSED == connection->state) ||
-           (MHD_CONNECTION_IN_CLEANUP == connection->state) )
+           (MHD_CONNECTION_CLOSED == connection->state) )
         return NULL; /* invalid, too early! */
       return (const union MHD_ConnectionInfo *) &connection->header_size;
     default:
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 14cc0121..6179f2bc 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -2066,21 +2066,18 @@ thread_main_handle_connection (void *data)
         }
 #endif /* UPGRADE_SUPPORT */
     }
-  if (MHD_CONNECTION_IN_CLEANUP != con->state)
-    {
 #if DEBUG_CLOSE
 #ifdef HAVE_MESSAGES
-      MHD_DLOG (con->daemon,
-                _("Processing thread terminating. Closing connection\n"));
+  MHD_DLOG (con->daemon,
+            _("Processing thread terminating. Closing connection\n"));
 #endif
 #endif
-      if (MHD_CONNECTION_CLOSED != con->state)
-       MHD_connection_close_ (con,
-                               (daemon->shutdown) ?
-                               MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN:
-                               MHD_REQUEST_TERMINATED_WITH_ERROR);
-      MHD_connection_handle_idle (con);
-    }
+  if (MHD_CONNECTION_CLOSED != con->state)
+    MHD_connection_close_ (con,
+                           (daemon->shutdown) ?
+                           MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN:
+                           MHD_REQUEST_TERMINATED_WITH_ERROR);
+  MHD_connection_handle_idle (con);
 exit:
   if (NULL != con->response)
     {
@@ -2753,7 +2750,7 @@ resume_suspended_connections (struct MHD_Daemon *daemon)
           DLL_insert (daemon->connections_head,
                       daemon->connections_tail,
                       pos);
-          if (!used_thr_p_c)
+          if (! used_thr_p_c)
             {
               /* Reset timeout timer on resume. */
               if (0 != pos->connection_timeout)
@@ -2790,8 +2787,15 @@ resume_suspended_connections (struct MHD_Daemon *daemon)
           /* Data forwarding was finished (for TLS connections) AND
            * application was closed upgraded connection.
            * Insert connection into cleanup list. */
-          MHD_connection_close_ (pos,
-                                 MHD_REQUEST_TERMINATED_COMPLETED_OK);
+
+          if ( (NULL != daemon->notify_completed) &&
+               (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) &&
+               (pos->client_aware) )
+            daemon->notify_completed (daemon->notify_completed_cls,
+                                      pos,
+                                      &pos->client_context,
+                                      MHD_REQUEST_TERMINATED_COMPLETED_OK);
+          pos->client_aware = false;
           DLL_insert (daemon->cleanup_head,
                       daemon->cleanup_tail,
                       pos);
@@ -3355,8 +3359,10 @@ MHD_run_from_select (struct MHD_Daemon *daemon,
   if (0 != (daemon->options & MHD_TEST_ALLOW_SUSPEND_RESUME))
     resume_suspended_connections (daemon);
 
-  return internal_run_from_select (daemon, read_fd_set,
-                                   write_fd_set, except_fd_set);
+  return internal_run_from_select (daemon,
+                                   read_fd_set,
+                                   write_fd_set,
+                                   except_fd_set);
 }
 
 
@@ -3783,7 +3789,7 @@ MHD_poll_listen_socket (struct MHD_Daemon *daemon,
     }
 
   if (0 != (daemon->options & MHD_TEST_ALLOW_SUSPEND_RESUME))
-    (void)resume_suspended_connections (daemon);
+    (void) resume_suspended_connections (daemon);
 
   if (MHD_NO == may_block)
     timeout = 0;
@@ -4388,7 +4394,7 @@ close_connection (struct MHD_Connection *pos)
 
   mhd_assert (! pos->suspended);
   mhd_assert (! pos->resuming);
-  if (pos->connection_timeout == pos->daemon->connection_timeout)
+  if (pos->connection_timeout == daemon->connection_timeout)
     XDLL_remove (daemon->normal_timeout_head,
                 daemon->normal_timeout_tail,
                 pos);
@@ -4436,6 +4442,8 @@ MHD_polling_thread (void *cls)
   /* Resume any pending for resume connections, join
    * all connection's threads (if any) and finally cleanup
    * everything. */
+  if (0 != (MHD_TEST_ALLOW_SUSPEND_RESUME & daemon->options))
+    resume_suspended_connections (daemon);
   close_all_connections (daemon);
 
   return (MHD_THRD_RTRN_TYPE_)0;
@@ -6307,7 +6315,8 @@ MHD_stop_daemon (struct MHD_Daemon *daemon)
           daemon->worker_pool[i].shutdown = true;
           if (MHD_ITC_IS_VALID_(daemon->worker_pool[i].itc))
             {
-              if (! MHD_itc_activate_ (daemon->worker_pool[i].itc, "e"))
+              if (! MHD_itc_activate_ (daemon->worker_pool[i].itc,
+                                       "e"))
                 MHD_PANIC (_("Failed to signal shutdown via inter-thread 
communication channel."));
             }
           else
@@ -6338,13 +6347,11 @@ MHD_stop_daemon (struct MHD_Daemon *daemon)
       if (0 != (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD))
         { /* Worker daemon or single daemon with internal thread(s). */
           mhd_assert (0 == daemon->worker_pool_size);
-          if (0 != (MHD_TEST_ALLOW_SUSPEND_RESUME & daemon->options))
-            resume_suspended_connections (daemon);
-
          /* Separate thread(s) is used for polling sockets. */
-         if (MHD_ITC_IS_VALID_(daemon->itc))
+         if (MHD_ITC_IS_VALID_ (daemon->itc))
            {
-             if (! MHD_itc_activate_ (daemon->itc, "e"))
+             if (! MHD_itc_activate_ (daemon->itc,
+                                       "e"))
                MHD_PANIC (_("Failed to signal shutdown via inter-thread 
communication channel"));
            }
          else
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index 5668a8f8..01f2dbea 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -507,11 +507,6 @@ enum MHD_CONNECTION_STATE
    */
   MHD_CONNECTION_CLOSED = MHD_CONNECTION_FOOTERS_SENT + 1,
 
-  /**
-   * 20: This connection is finished (only to be freed)
-   */
-  MHD_CONNECTION_IN_CLEANUP = MHD_CONNECTION_CLOSED + 1,
-
 #ifdef UPGRADE_SUPPORT
   /**
    * Connection was "upgraded" and socket is now under the
diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c
index fa4ffd21..6c26104e 100644
--- a/src/microhttpd/test_upgrade.c
+++ b/src/microhttpd/test_upgrade.c
@@ -447,7 +447,8 @@ notify_completed_cb (void *cls,
 {
   pthread_t* ppth = *con_cls;
 
-  (void)cls; (void)connection;  /* Unused. Silent compiler warning. */
+  (void) cls;
+  (void) connection;  /* Unused. Silent compiler warning. */
   if ( (toe != MHD_REQUEST_TERMINATED_COMPLETED_OK) &&
        (toe != MHD_REQUEST_TERMINATED_CLIENT_ABORT) &&
        (toe != MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN) )
@@ -474,13 +475,14 @@ log_cb (void *cls,
         const char *uri,
         struct MHD_Connection *connection)
 {
-  pthread_t* ppth;
-  (void)cls; (void)connection;  /* Unused. Silent compiler warning. */
+  pthread_t *ppth;
 
+  (void) cls;
+  (void) connection;  /* Unused. Silent compiler warning. */
   if (0 != strcmp (uri,
                    "/"))
     abort ();
-  ppth = (pthread_t*) malloc (sizeof(pthread_t));
+  ppth = malloc (sizeof (pthread_t));
   if (NULL == ppth)
     abort();
   *ppth = pthread_self ();
@@ -514,8 +516,9 @@ notify_connection_cb (void *cls,
                       enum MHD_ConnectionNotificationCode toe)
 {
   static int started;
-  (void)cls; (void)connection;  /* Unused. Silent compiler warning. */
 
+  (void) cls;
+  (void) connection;  /* Unused. Silent compiler warning. */
   switch (toe)
   {
   case MHD_CONNECTION_NOTIFY_STARTED:
@@ -773,7 +776,11 @@ upgrade_cb (void *cls,
             MHD_socket sock,
             struct MHD_UpgradeResponseHandle *urh)
 {
-  (void)cls; (void)connection; (void)con_cls; (void)extra_in; /* Unused. 
Silent compiler warning. */
+  (void) cls;
+  (void) connection;
+  (void) con_cls;
+  (void) extra_in; /* Unused. Silent compiler warning. */
+
   usock = wr_create_from_plain_sckt (sock);
   if (0 != extra_in_size)
     abort ();
@@ -836,8 +843,12 @@ ahc_upgrade (void *cls,
 {
   struct MHD_Response *resp;
   int ret;
-  (void)cls;(void)url;(void)method;                        /* Unused. Silent 
compiler warning. */
-  (void)version;(void)upload_data;(void)upload_data_size;  /* Unused. Silent 
compiler warning. */
+  (void) cls;
+  (void) url;
+  (void) method;                        /* Unused. Silent compiler warning. */
+  (void) version;
+  (void) upload_data;
+  (void) upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (NULL == *con_cls)
     abort ();
@@ -1008,7 +1019,7 @@ test_upgrade (int flags,
 
   done = false;
 
-  if (!test_tls)
+  if (! test_tls)
     d = MHD_start_daemon (flags | MHD_USE_ERROR_LOG | MHD_ALLOW_UPGRADE,
                          
MHD_is_feature_supported(MHD_FEATURE_AUTODETECT_BIND_PORT) ?
                              0 : 1090,
@@ -1036,10 +1047,12 @@ test_upgrade (int flags,
 #endif /* HTTPS_SUPPORT */
   if (NULL == d)
     return 2;
-  real_flags = MHD_get_daemon_info(d, MHD_DAEMON_INFO_FLAGS);
+  real_flags = MHD_get_daemon_info(d,
+                                   MHD_DAEMON_INFO_FLAGS);
   if (NULL == real_flags)
     abort ();
-  dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT);
+  dinfo = MHD_get_daemon_info (d,
+                               MHD_DAEMON_INFO_BIND_PORT);
   if (NULL == dinfo || 0 == dinfo->port)
     abort ();
   if (!test_tls || TLS_LIB_GNUTLS == use_tls_tool)
@@ -1059,7 +1072,8 @@ test_upgrade (int flags,
     {
 #if defined(HTTPS_SUPPORT) && defined(HAVE_FORK) && defined(HAVE_WAITPID)
       MHD_socket tls_fork_sock;
-      if (-1 == (pid = gnutlscli_connect (&tls_fork_sock, dinfo->port)))
+      if (-1 == (pid = gnutlscli_connect (&tls_fork_sock,
+                                          dinfo->port)))
         {
           MHD_stop_daemon (d);
           return 4;
@@ -1103,7 +1117,8 @@ main (int argc,
   test_tls = has_in_name(argv[0], "_tls");
 
   verbose = 1;
-  if (has_param(argc, argv, "-q") || has_param(argc, argv, "--quiet"))
+  if (has_param(argc, argv, "-q") ||
+      has_param(argc, argv, "--quiet"))
     verbose = 0;
 
   if (test_tls)
@@ -1152,13 +1167,16 @@ main (int argc,
 
   /* run tests */
   if (verbose)
-    printf ("Starting HTTP \"Upgrade\" tests with %s connections.\n", test_tls 
? "TLS" : "plain");
+    printf ("Starting HTTP \"Upgrade\" tests with %s connections.\n",
+            test_tls ? "TLS" : "plain");
   /* try external select */
   res = test_upgrade (0,
                       0);
   error_count += res;
   if (res)
-    fprintf (stderr, "FAILED: Upgrade with external select, return code 
%d.\n", res);
+    fprintf (stderr,
+             "FAILED: Upgrade with external select, return code %d.\n",
+             res);
   else if (verbose)
     printf ("PASSED: Upgrade with external select.\n");
 
@@ -1167,7 +1185,9 @@ main (int argc,
                       0);
   error_count += res;
   if (res)
-    fprintf (stderr, "FAILED: Upgrade with external 'auto', return code 
%d.\n", res);
+    fprintf (stderr,
+             "FAILED: Upgrade with external 'auto', return code %d.\n",
+             res);
   else if (verbose)
     printf ("PASSED: Upgrade with external 'auto'.\n");
 
@@ -1176,7 +1196,9 @@ main (int argc,
                       0);
   error_count += res;
   if (res)
-    fprintf (stderr, "FAILED: Upgrade with external select with EPOLL, return 
code %d.\n", res);
+    fprintf (stderr,
+             "FAILED: Upgrade with external select with EPOLL, return code 
%d.\n",
+             res);
   else if (verbose)
     printf ("PASSED: Upgrade with external select with EPOLL.\n");
 #endif
@@ -1186,7 +1208,9 @@ main (int argc,
                       0);
   error_count += res;
   if (res)
-    fprintf (stderr, "FAILED: Upgrade with thread per connection, return code 
%d.\n", res);
+    fprintf (stderr,
+             "FAILED: Upgrade with thread per connection, return code %d.\n",
+             res);
   else if (verbose)
     printf ("PASSED: Upgrade with thread per connection.\n");
 
@@ -1194,7 +1218,9 @@ main (int argc,
                       0);
   error_count += res;
   if (res)
-    fprintf (stderr, "FAILED: Upgrade with thread per connection and 'auto', 
return code %d.\n", res);
+    fprintf (stderr,
+             "FAILED: Upgrade with thread per connection and 'auto', return 
code %d.\n",
+             res);
   else if (verbose)
     printf ("PASSED: Upgrade with thread per connection and 'auto'.\n");
 #ifdef HAVE_POLL
@@ -1202,7 +1228,9 @@ main (int argc,
                       0);
   error_count += res;
   if (res)
-    fprintf (stderr, "FAILED: Upgrade with thread per connection and poll, 
return code %d.\n", res);
+    fprintf (stderr,
+             "FAILED: Upgrade with thread per connection and poll, return code 
%d.\n",
+             res);
   else if (verbose)
     printf ("PASSED: Upgrade with thread per connection and poll.\n");
 #endif /* HAVE_POLL */
@@ -1212,28 +1240,36 @@ main (int argc,
                       0);
   error_count += res;
   if (res)
-    fprintf (stderr, "FAILED: Upgrade with internal select, return code 
%d.\n", res);
+    fprintf (stderr,
+             "FAILED: Upgrade with internal select, return code %d.\n",
+             res);
   else if (verbose)
     printf ("PASSED: Upgrade with internal select.\n");
   res = test_upgrade (MHD_USE_INTERNAL_POLLING_THREAD,
                       2);
   error_count += res;
   if (res)
-    fprintf (stderr, "FAILED: Upgrade with internal select with thread pool, 
return code %d.\n", res);
+    fprintf (stderr,
+             "FAILED: Upgrade with internal select with thread pool, return 
code %d.\n",
+             res);
   else if (verbose)
     printf ("PASSED: Upgrade with internal select with thread pool.\n");
   res = test_upgrade (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD,
                       0);
   error_count += res;
   if (res)
-    fprintf (stderr, "FAILED: Upgrade with internal 'auto' return code %d.\n", 
res);
+    fprintf (stderr,
+             "FAILED: Upgrade with internal 'auto' return code %d.\n",
+             res);
   else if (verbose)
     printf ("PASSED: Upgrade with internal 'auto'.\n");
   res = test_upgrade (MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD,
                       2);
   error_count += res;
   if (res)
-    fprintf (stderr, "FAILED: Upgrade with internal 'auto' with thread pool, 
return code %d.\n", res);
+    fprintf (stderr,
+             "FAILED: Upgrade with internal 'auto' with thread pool, return 
code %d.\n",
+             res);
   else if (verbose)
     printf ("PASSED: Upgrade with internal 'auto' with thread pool.\n");
 #ifdef HAVE_POLL
@@ -1241,13 +1277,17 @@ main (int argc,
                       0);
   error_count += res;
   if (res)
-    fprintf (stderr, "FAILED: Upgrade with internal poll, return code %d.\n", 
res);
+    fprintf (stderr,
+             "FAILED: Upgrade with internal poll, return code %d.\n",
+             res);
   else if (verbose)
     printf ("PASSED: Upgrade with internal poll.\n");
   res = test_upgrade (MHD_USE_POLL_INTERNAL_THREAD,
                       2);
   if (res)
-    fprintf (stderr, "FAILED: Upgrade with internal poll with thread pool, 
return code %d.\n", res);
+    fprintf (stderr,
+             "FAILED: Upgrade with internal poll with thread pool, return code 
%d.\n",
+             res);
   else if (verbose)
     printf ("PASSED: Upgrade with internal poll with thread pool.\n");
 #endif
@@ -1255,13 +1295,17 @@ main (int argc,
   res = test_upgrade (MHD_USE_EPOLL_INTERNAL_THREAD,
                       0);
   if (res)
-    fprintf (stderr, "FAILED: Upgrade with internal epoll, return code %d.\n", 
res);
+    fprintf (stderr,
+             "FAILED: Upgrade with internal epoll, return code %d.\n",
+             res);
   else if (verbose)
     printf ("PASSED: Upgrade with internal epoll.\n");
   res = test_upgrade (MHD_USE_EPOLL_INTERNAL_THREAD,
                       2);
   if (res)
-    fprintf (stderr, "FAILED: Upgrade with internal epoll, return code %d.\n", 
res);
+    fprintf (stderr,
+             "FAILED: Upgrade with internal epoll, return code %d.\n",
+             res);
   else if (verbose)
     printf ("PASSED: Upgrade with internal epoll.\n");
 #endif

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



reply via email to

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