gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] 10/13: MHD_connection_handle_read(): refactored states h


From: gnunet
Subject: [libmicrohttpd] 10/13: MHD_connection_handle_read(): refactored states handling at the end of the function
Date: Mon, 16 May 2022 20:14:59 +0200

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit f0a5b72f56f386803fd4efde86a0864c463e62f9
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Mon May 16 19:41:54 2022 +0300

    MHD_connection_handle_read(): refactored states handling at the end of the 
function
---
 src/microhttpd/connection.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 7ae01a53..be9d65b1 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -4133,6 +4133,7 @@ MHD_connection_handle_read (struct MHD_Connection 
*connection,
             __FUNCTION__,
             MHD_state_to_string (connection->state));
 #endif
+  /* TODO: check whether the next 'switch()' really needed */
   switch (connection->state)
   {
   case MHD_CONNECTION_INIT:
@@ -4162,8 +4163,9 @@ MHD_connection_handle_read (struct MHD_Connection 
*connection,
     mhd_assert (0);
     return;
 #endif /* UPGRADE_SUPPORT */
-  default:
+  case MHD_CONNECTION_START_REPLY:
     /* shrink read buffer to how much is actually used */
+    /* TODO: remove shrink as it handled in special function */
     if ((0 != connection->read_buffer_size) &&
         (connection->read_buffer_size != connection->read_buffer_offset))
     {
@@ -4176,6 +4178,17 @@ MHD_connection_handle_read (struct MHD_Connection 
*connection,
       connection->read_buffer_size = connection->read_buffer_offset;
     }
     break;
+  case MHD_CONNECTION_HEADERS_SENDING:
+  case MHD_CONNECTION_HEADERS_SENT:
+  case MHD_CONNECTION_NORMAL_BODY_UNREADY:
+  case MHD_CONNECTION_NORMAL_BODY_READY:
+  case MHD_CONNECTION_CHUNKED_BODY_UNREADY:
+  case MHD_CONNECTION_CHUNKED_BODY_READY:
+  case MHD_CONNECTION_BODY_SENT:
+  case MHD_CONNECTION_FOOTERS_SENDING:
+  case MHD_CONNECTION_FOOTERS_SENT:
+  default:
+    mhd_assert (0); /* Should not be possible */
   }
   return;
 }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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