gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] 01/02: Added missing update of connection's read buffer


From: gnunet
Subject: [libmicrohttpd] 01/02: Added missing update of connection's read buffer size
Date: Sun, 10 Oct 2021 20:51:04 +0200

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 4524fbe23f82662ab80107a430fc0384cd2230c7
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Fri Oct 8 10:14:58 2021 +0300

    Added missing update of connection's read buffer size
---
 src/microhttpd/connection.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 536bb28f..654e4192 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -3683,10 +3683,17 @@ MHD_connection_handle_read (struct MHD_Connection 
*connection)
 #endif /* UPGRADE_SUPPORT */
   default:
     /* shrink read buffer to how much is actually used */
-    MHD_pool_reallocate (connection->pool,
-                         connection->read_buffer,
-                         connection->read_buffer_size,
-                         connection->read_buffer_offset);
+    if ((0 != connection->read_buffer_size) &&
+        (connection->read_buffer_size != connection->read_buffer_offset))
+    {
+      mhd_assert (NULL != connection->read_buffer);
+      connection->read_buffer =
+        MHD_pool_reallocate (connection->pool,
+                             connection->read_buffer,
+                             connection->read_buffer_size,
+                             connection->read_buffer_offset);
+      connection->read_buffer_size = connection->read_buffer_offset;
+    }
     break;
   }
   return;

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