[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.
- [libmicrohttpd] branch master updated (c07f4464 -> d7cac578), gnunet, 2021/09/29
- [libmicrohttpd] 01/10: connection.c: fixed compile with disabled messages, gnunet, 2021/09/29
- [libmicrohttpd] 04/10: transmit_error_response(): avoid double sending of error responses,
gnunet <=
- [libmicrohttpd] 02/10: memorypool: added assert in MHD_pool_reallocate(), gnunet, 2021/09/29
- [libmicrohttpd] 03/10: connection_close_error(): fixed set of error flag with messages disabled, gnunet, 2021/09/29
- [libmicrohttpd] 08/10: transmit_error_response(): improved error log messages, gnunet, 2021/09/29
- [libmicrohttpd] 05/10: connection_reset(): notify app with correct code, gnunet, 2021/09/29
- [libmicrohttpd] 06/10: transmit_error_response(): check whether it is still possible to send a response, gnunet, 2021/09/29
- [libmicrohttpd] 07/10: transmit_error_response(): log error if response cannot be created, gnunet, 2021/09/29
- [libmicrohttpd] 09/10: transmit_error_response(): reset read buffer offset as well, gnunet, 2021/09/29
- [libmicrohttpd] 10/10: connection_maximize_write_buffer(): don't try to grow if no space is available, gnunet, 2021/09/29