gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] 05/05: chunked responses: alway unlock response if closi


From: gnunet
Subject: [libmicrohttpd] 05/05: chunked responses: alway unlock response if closing the connection
Date: Wed, 27 Oct 2021 19:56:45 +0200

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 60cdf5f9e638e0831eda1feac857e8a940e155a6
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Tue Oct 26 13:16:59 2021 +0300

    chunked responses: alway unlock response if closing the connection
---
 src/microhttpd/connection.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index c23e9e5c..33d54234 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -1135,7 +1135,7 @@ try_ready_chunked_body (struct MHD_Connection *connection,
                               _ ("Closing connection (out of memory)."));
       return MHD_NO;
     }
-    /* Limit the buffer size to the large usable size for chunks */
+    /* Limit the buffer size to the largest usable size for chunks */
     if ( (max_chunk + max_chunk_overhead) < size)
       size = max_chunk + max_chunk_overhead;
     connection->write_buffer = MHD_pool_reallocate (connection->pool,
@@ -1183,6 +1183,9 @@ try_ready_chunked_body (struct MHD_Connection *connection,
   {
     if (NULL == response->crc)
     { /* There is no way to reach this code */
+#if defined(MHD_USE_THREADS)
+      MHD_mutex_unlock_chk_ (&response->mutex);
+#endif
       CONNECTION_CLOSE_ERROR (connection,
                               _ ("No callback for the chunked data."));
       return MHD_NO;
@@ -1222,6 +1225,9 @@ try_ready_chunked_body (struct MHD_Connection *connection,
   }
   if (size_to_fill < (size_t) ret)
   {
+#if defined(MHD_USE_THREADS)
+    MHD_mutex_unlock_chk_ (&response->mutex);
+#endif
     CONNECTION_CLOSE_ERROR (connection,
                             _ ("Closing connection (application returned " \
                                "more data than requested)."));

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