diff options
Diffstat (limited to 'src/microhttpd/connection.c')
-rw-r--r-- | src/microhttpd/connection.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 3161ab8f..faf61838 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c | |||
@@ -1569,13 +1569,14 @@ connection_maximize_write_buffer (struct MHD_Connection *connection) | |||
1569 | if (0 != free_size) | 1569 | if (0 != free_size) |
1570 | { | 1570 | { |
1571 | new_size = c->write_buffer_size + free_size; | 1571 | new_size = c->write_buffer_size + free_size; |
1572 | /* This function must not move the buffer position. | ||
1573 | * MHD_pool_reallocate () may return the new position only if buffer was | ||
1574 | * allocated 'from_end' or is not the last allocation, | ||
1575 | * which should not happen. */ | ||
1572 | new_buf = MHD_pool_reallocate (pool, | 1576 | new_buf = MHD_pool_reallocate (pool, |
1573 | c->write_buffer, | 1577 | c->write_buffer, |
1574 | c->write_buffer_size, | 1578 | c->write_buffer_size, |
1575 | new_size); | 1579 | new_size); |
1576 | /* Buffer position must not be moved. | ||
1577 | * Position could be moved only if buffer was allocated 'from_end', | ||
1578 | * which cannot happen. */ | ||
1579 | mhd_assert ((c->write_buffer == new_buf) || (NULL == c->write_buffer)); | 1580 | mhd_assert ((c->write_buffer == new_buf) || (NULL == c->write_buffer)); |
1580 | c->write_buffer = new_buf; | 1581 | c->write_buffer = new_buf; |
1581 | c->write_buffer_size = new_size; | 1582 | c->write_buffer_size = new_size; |