[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 01/03: MHD_connection_close_ (): changed clean-up order
From: |
gnunet |
Subject: |
[libmicrohttpd] 01/03: MHD_connection_close_ (): changed clean-up order |
Date: |
Thu, 29 Jul 2021 20:44:49 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit c106ce2a4fe8df3fe82b5d13ae4ec8b4d42b811b
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Thu Jul 29 21:04:51 2021 +0300
MHD_connection_close_ (): changed clean-up order
* Mark connection as "ready for closure" only after clean-up
* Destroy response only after notifying of the client
---
src/microhttpd/connection.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 93ff695b..ba9cb498 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -720,13 +720,6 @@ MHD_connection_close_ (struct MHD_Connection *connection,
mhd_assert ( (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) || \
MHD_thread_ID_match_current_ (connection->pid) );
#endif /* MHD_USE_THREADS */
-
- MHD_connection_mark_closed_ (connection);
- if (NULL != resp)
- {
- connection->response = NULL;
- MHD_destroy_response (resp);
- }
if ( (NULL != daemon->notify_completed) &&
(connection->client_aware) )
daemon->notify_completed (daemon->notify_completed_cls,
@@ -734,6 +727,13 @@ MHD_connection_close_ (struct MHD_Connection *connection,
&connection->client_context,
termination_code);
connection->client_aware = false;
+ if (NULL != resp)
+ {
+ connection->response = NULL;
+ MHD_destroy_response (resp);
+ }
+
+ MHD_connection_mark_closed_ (connection);
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.