diff options
Diffstat (limited to 'src/microhttpd/connection.c')
-rw-r--r-- | src/microhttpd/connection.c | 15 |
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; |