gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] 05/06: MHD_connection_handle_read(): simpli


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] 05/06: MHD_connection_handle_read(): simplified and unified code, removed dead code. Functionality is unchanged.
Date: Mon, 05 Jun 2017 22:49:08 +0200

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 37518ba48fa12c128d7615f2f1d3dc2f281e8dfd
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Mon Jun 5 23:27:04 2017 +0300

    MHD_connection_handle_read(): simplified and unified code, removed dead 
code.
    Functionality is unchanged.
---
 src/microhttpd/connection.c | 69 +++++++++++++++++++++------------------------
 1 file changed, 32 insertions(+), 37 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 38a700fb..eb3b09f6 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -2717,48 +2717,43 @@ MHD_connection_handle_read (struct MHD_Connection 
*connection)
     }
   connection->read_buffer_offset += bytes_read;
   MHD_update_last_activity_ (connection);
-  while (1)
-    {
 #if DEBUG_STATES
-      MHD_DLOG (connection->daemon,
-                _("In function %s handling connection at state: %s\n"),
-                __FUNCTION__,
-                MHD_state_to_string (connection->state));
+  MHD_DLOG (connection->daemon,
+            _("In function %s handling connection at state: %s\n"),
+            __FUNCTION__,
+            MHD_state_to_string (connection->state));
 #endif
-      switch (connection->state)
+  switch (connection->state)
+    {
+    case MHD_CONNECTION_INIT:
+    case MHD_CONNECTION_URL_RECEIVED:
+    case MHD_CONNECTION_HEADER_PART_RECEIVED:
+    case MHD_CONNECTION_HEADERS_RECEIVED:
+    case MHD_CONNECTION_HEADERS_PROCESSED:
+    case MHD_CONNECTION_CONTINUE_SENDING:
+    case MHD_CONNECTION_CONTINUE_SENT:
+    case MHD_CONNECTION_BODY_RECEIVED:
+    case MHD_CONNECTION_FOOTER_PART_RECEIVED:
+      /* nothing to do but default action */
+      if (connection->read_closed)
         {
-        case MHD_CONNECTION_INIT:
-        case MHD_CONNECTION_URL_RECEIVED:
-        case MHD_CONNECTION_HEADER_PART_RECEIVED:
-        case MHD_CONNECTION_HEADERS_RECEIVED:
-        case MHD_CONNECTION_HEADERS_PROCESSED:
-        case MHD_CONNECTION_CONTINUE_SENDING:
-        case MHD_CONNECTION_CONTINUE_SENT:
-        case MHD_CONNECTION_BODY_RECEIVED:
-        case MHD_CONNECTION_FOOTER_PART_RECEIVED:
-          /* nothing to do but default action */
-          if (connection->read_closed)
-            {
-             MHD_connection_close_ (connection,
-                                     MHD_REQUEST_TERMINATED_READ_ERROR);
-              continue;
-            }
-          break;
-        case MHD_CONNECTION_CLOSED:
-          return;
+          MHD_connection_close_ (connection,
+                                 MHD_REQUEST_TERMINATED_READ_ERROR);
+        }
+      return;
+    case MHD_CONNECTION_CLOSED:
+      return;
 #ifdef UPGRADE_SUPPORT
-        case MHD_CONNECTION_UPGRADE:
-          EXTRA_CHECK (0);
-          break;
+    case MHD_CONNECTION_UPGRADE:
+      EXTRA_CHECK (0);
+      return;
 #endif /* UPGRADE_SUPPORT */
-        default:
-          /* shrink read buffer to how much is actually used */
-          MHD_pool_reallocate (connection->pool,
-                               connection->read_buffer,
-                               connection->read_buffer_size + 1,
-                               connection->read_buffer_offset);
-          break;
-        }
+    default:
+      /* shrink read buffer to how much is actually used */
+      MHD_pool_reallocate (connection->pool,
+                           connection->read_buffer,
+                           connection->read_buffer_size + 1,
+                           connection->read_buffer_offset);
       break;
     }
   return;

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



reply via email to

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