aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-10-08 10:14:58 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-10-10 21:50:30 +0300
commit4524fbe23f82662ab80107a430fc0384cd2230c7 (patch)
tree4ca46da69fd51b99ea50910f52c74d44f9b3025b
parenta3c8bf22fb1e48b74bbe14ceb723a7f708470916 (diff)
downloadlibmicrohttpd-4524fbe23f82662ab80107a430fc0384cd2230c7.tar.gz
libmicrohttpd-4524fbe23f82662ab80107a430fc0384cd2230c7.zip
Added missing update of connection's read buffer size
-rw-r--r--src/microhttpd/connection.c15
1 files 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)
3683#endif /* UPGRADE_SUPPORT */ 3683#endif /* UPGRADE_SUPPORT */
3684 default: 3684 default:
3685 /* shrink read buffer to how much is actually used */ 3685 /* shrink read buffer to how much is actually used */
3686 MHD_pool_reallocate (connection->pool, 3686 if ((0 != connection->read_buffer_size) &&
3687 connection->read_buffer, 3687 (connection->read_buffer_size != connection->read_buffer_offset))
3688 connection->read_buffer_size, 3688 {
3689 connection->read_buffer_offset); 3689 mhd_assert (NULL != connection->read_buffer);
3690 connection->read_buffer =
3691 MHD_pool_reallocate (connection->pool,
3692 connection->read_buffer,
3693 connection->read_buffer_size,
3694 connection->read_buffer_offset);
3695 connection->read_buffer_size = connection->read_buffer_offset;
3696 }
3690 break; 3697 break;
3691 } 3698 }
3692 return; 3699 return;