gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] branch master updated (cdc1db3d -> 732bc0a0)


From: gnunet
Subject: [libmicrohttpd] branch master updated (cdc1db3d -> 732bc0a0)
Date: Sat, 05 Jun 2021 14:39:15 +0200

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from cdc1db3d test_get_chunked: implemented TODOs
     new 9ca0b36a connection: do not spend time on building footers for 
zero-sized responses
     new 2ccc281a connection: handle large read-ahead situation
     new 732bc0a0 connection: fixed wrong read buffer reallocation

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/microhttpd/connection.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 938031c4..b240e14a 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -3044,7 +3044,7 @@ MHD_connection_handle_read (struct MHD_Connection 
*connection)
     /* shrink read buffer to how much is actually used */
     MHD_pool_reallocate (connection->pool,
                          connection->read_buffer,
-                         connection->read_buffer_size + 1,
+                         connection->read_buffer_size,
                          connection->read_buffer_offset);
     break;
   }
@@ -3779,7 +3779,11 @@ MHD_connection_handle_idle (struct MHD_Connection 
*connection)
         if (NULL != connection->response->crc)
           MHD_mutex_unlock_chk_ (&connection->response->mutex);
 #endif
-        connection->state = MHD_CONNECTION_BODY_SENT;
+        /* TODO: replace with 'use_chunked_send' */
+        if (connection->have_chunked_upload)
+          connection->state = MHD_CONNECTION_BODY_SENT;
+        else
+          connection->state = MHD_CONNECTION_FOOTERS_SENT;
         continue;
       }
       if (MHD_NO != try_ready_normal_body (connection))
@@ -3883,6 +3887,7 @@ MHD_connection_handle_idle (struct MHD_Connection 
*connection)
       else
       {
         /* can try to keep-alive */
+        size_t new_read_buf_size;
 
         connection->version = NULL;
         connection->http_ver = MHD_HTTP_VER_UNKNOWN;
@@ -3893,13 +3898,16 @@ MHD_connection_handle_idle (struct MHD_Connection 
*connection)
         connection->keepalive = MHD_CONN_KEEPALIVE_UNKOWN;
         /* Reset the read buffer to the starting size,
            preserving the bytes we have already read. */
+        if (connection->read_buffer_offset > connection->daemon->pool_size / 2)
+          new_read_buf_size = connection->read_buffer_offset;
+        else
+          new_read_buf_size = connection->daemon->pool_size / 2;
         connection->read_buffer
           = MHD_pool_reset (connection->pool,
                             connection->read_buffer,
                             connection->read_buffer_offset,
-                            connection->daemon->pool_size / 2);
-        connection->read_buffer_size
-          = connection->daemon->pool_size / 2;
+                            new_read_buf_size);
+        connection->read_buffer_size = new_read_buf_size;
       }
       connection->client_context = NULL;
       connection->continue_message_write_offset = 0;

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