gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] 05/06: connection.c: added asserts for connection's stat


From: gnunet
Subject: [libmicrohttpd] 05/06: connection.c: added asserts for connection's states processing logic
Date: Tue, 27 Sep 2022 18:02:19 +0200

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 75d385212289b810d005c140c73709e594b02ade
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Tue Sep 27 17:39:21 2022 +0300

    connection.c: added asserts for connection's states processing logic
---
 src/microhttpd/connection.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 1dca8f94..18bb36d6 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -5103,9 +5103,13 @@ MHD_connection_handle_idle (struct MHD_Connection 
*connection)
         connection->state = MHD_CONNECTION_FULL_REPLY_SENT;
       continue;
     case MHD_CONNECTION_NORMAL_BODY_READY:
+      mhd_assert (connection->rp.props.send_reply_body);
+      mhd_assert (! connection->rp.props.chunked);
       /* nothing to do here */
       break;
     case MHD_CONNECTION_NORMAL_BODY_UNREADY:
+      mhd_assert (connection->rp.props.send_reply_body);
+      mhd_assert (! connection->rp.props.chunked);
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
       if (NULL != connection->rp.response->crc)
         MHD_mutex_lock_chk_ (&connection->rp.response->mutex);
@@ -5137,9 +5141,13 @@ MHD_connection_handle_idle (struct MHD_Connection 
*connection)
       /* not ready, no socket action */
       break;
     case MHD_CONNECTION_CHUNKED_BODY_READY:
+      mhd_assert (connection->rp.props.send_reply_body);
+      mhd_assert (connection->rp.props.chunked);
       /* nothing to do here */
       break;
     case MHD_CONNECTION_CHUNKED_BODY_UNREADY:
+      mhd_assert (connection->rp.props.send_reply_body);
+      mhd_assert (connection->rp.props.chunked);
 #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS)
       if (NULL != connection->rp.response->crc)
         MHD_mutex_lock_chk_ (&connection->rp.response->mutex);
@@ -5172,7 +5180,10 @@ MHD_connection_handle_idle (struct MHD_Connection 
*connection)
       }
       break;
     case MHD_CONNECTION_CHUNKED_BODY_SENT:
+      mhd_assert (connection->rp.props.send_reply_body);
       mhd_assert (connection->rp.props.chunked);
+      mhd_assert (connection->write_buffer_send_offset <= \
+                  connection->write_buffer_append_offset);
 
       if (MHD_NO == build_connection_chunked_response_footer (connection))
       {
@@ -5191,6 +5202,8 @@ MHD_connection_handle_idle (struct MHD_Connection 
*connection)
         connection->state = MHD_CONNECTION_FOOTERS_SENDING;
       continue;
     case MHD_CONNECTION_FOOTERS_SENDING:
+      mhd_assert (connection->rp.props.send_reply_body);
+      mhd_assert (connection->rp.props.chunked);
       /* no default action */
       break;
     case MHD_CONNECTION_FULL_REPLY_SENT:

-- 
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]