aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/response.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/response.c')
-rw-r--r--src/microhttpd/response.c33
1 files changed, 13 insertions, 20 deletions
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
index 159c8ecb..d125ea24 100644
--- a/src/microhttpd/response.c
+++ b/src/microhttpd/response.c
@@ -2148,28 +2148,21 @@ MHD_response_execute_upgrade_ (struct MHD_Response *response,
2148 size_t avail; 2148 size_t avail;
2149 char *buf; 2149 char *buf;
2150 2150
2151 if (0 != connection->write_buffer_size) 2151 /* All data should be sent already */
2152 { 2152 mhd_assert (connection->write_buffer_send_offset == \
2153 mhd_assert (NULL != connection->write_buffer); 2153 connection->write_buffer_append_offset);
2154 /* All data should be sent already */ 2154 MHD_pool_deallocate (pool, connection->write_buffer,
2155 mhd_assert (connection->write_buffer_send_offset == \ 2155 connection->write_buffer_size);
2156 connection->write_buffer_append_offset); 2156 connection->write_buffer_append_offset = 0;
2157 (void) MHD_pool_reallocate (pool, connection->write_buffer, 2157 connection->write_buffer_send_offset = 0;
2158 connection->write_buffer_size, 0); 2158 connection->write_buffer_size = 0;
2159 connection->write_buffer_append_offset = 0;
2160 connection->write_buffer_send_offset = 0;
2161 connection->write_buffer_size = 0;
2162 }
2163 connection->write_buffer = NULL; 2159 connection->write_buffer = NULL;
2164 2160
2165 if (0 != connection->read_buffer_size) 2161 /* Extra read data should be processed already by the application */
2166 { 2162 MHD_pool_deallocate (pool, connection->read_buffer,
2167 mhd_assert (NULL != connection->read_buffer); 2163 connection->read_buffer_size);
2168 (void) MHD_pool_reallocate (pool, connection->read_buffer, 2164 connection->read_buffer_offset = 0;
2169 connection->read_buffer_size, 0); 2165 connection->read_buffer_size = 0;
2170 connection->read_buffer_offset = 0;
2171 connection->read_buffer_size = 0;
2172 }
2173 connection->read_buffer = NULL; 2166 connection->read_buffer = NULL;
2174 2167
2175 avail = MHD_pool_get_free (pool); 2168 avail = MHD_pool_get_free (pool);