commit db643107ffb0c90948ad34922f671fa8af0c08bd
parent 6468c2338834fb2835471f12fadbedd63340cd8c
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Sat, 30 Oct 2021 18:07:08 +0300
connection_maximize_write_buffer(): fixed comment
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
@@ -1569,13 +1569,14 @@ connection_maximize_write_buffer (struct MHD_Connection *connection)
if (0 != free_size)
{
new_size = c->write_buffer_size + free_size;
+ /* This function must not move the buffer position.
+ * MHD_pool_reallocate () may return the new position only if buffer was
+ * allocated 'from_end' or is not the last allocation,
+ * which should not happen. */
new_buf = MHD_pool_reallocate (pool,
c->write_buffer,
c->write_buffer_size,
new_size);
- /* Buffer position must not be moved.
- * Position could be moved only if buffer was allocated 'from_end',
- * which cannot happen. */
mhd_assert ((c->write_buffer == new_buf) || (NULL == c->write_buffer));
c->write_buffer = new_buf;
c->write_buffer_size = new_size;