gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] 04/10: transmit_error_response(): avoid double sending o


From: gnunet
Subject: [libmicrohttpd] 04/10: transmit_error_response(): avoid double sending of error responses
Date: Wed, 29 Sep 2021 19:52:46 +0200

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit cb5332ab4328374822f3051e6effbfac1f03b815
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Wed Sep 29 17:30:15 2021 +0300

    transmit_error_response(): avoid double sending of error responses
---
 src/microhttpd/connection.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 65aa0842..a2049527 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -2200,6 +2200,14 @@ transmit_error_response_len (struct MHD_Connection 
*connection,
   struct MHD_Response *response;
   enum MHD_Result iret;
 
+  mhd_assert (! connection->stop_with_error); /* Send error one time only */
+  if (connection->stop_with_error)
+  { /* Should not happen */
+    if (MHD_CONNECTION_CLOSED > connection->state)
+      connection->state = MHD_CONNECTION_CLOSED;
+
+    return;
+  }
   connection->stop_with_error = true;
   /* TODO: remove when special error queue function is implemented */
   connection->state = MHD_CONNECTION_FULL_REQ_RECEIVED;

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