gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] 02/03: minimal logic simplifications


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] 02/03: minimal logic simplifications
Date: Fri, 02 Mar 2018 21:45:32 +0100

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

grothoff pushed a commit to branch master
in repository libmicrohttpd.

commit 73532f78bb3a1a07c091ef7123b3ab49347c0b95
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Mar 2 20:58:07 2018 +0100

    minimal logic simplifications
---
 src/microhttpd/connection.c   | 41 +++++++++++++++++++++--------------------
 src/microhttpd/daemon.c       |  9 ++++++---
 src/microhttpd/test_upgrade.c |  8 +++++---
 3 files changed, 32 insertions(+), 26 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index d8d12c70..66e9b394 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -2284,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)
@@ -2291,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,
@@ -2318,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;
@@ -2475,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,
@@ -2506,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
        }
@@ -3642,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) )
             {
@@ -3681,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;
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 24fbe082..8c196421 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -3350,8 +3350,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);
 }
 
 
@@ -6339,7 +6341,8 @@ MHD_stop_daemon (struct MHD_Daemon *daemon)
          /* Separate thread(s) is used for polling sockets. */
          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/test_upgrade.c b/src/microhttpd/test_upgrade.c
index fa4ffd21..1b018ad4 100644
--- a/src/microhttpd/test_upgrade.c
+++ b/src/microhttpd/test_upgrade.c
@@ -1008,7 +1008,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 +1036,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)

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



reply via email to

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