libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 6b5e509ff088d05c1033c6773169d8d001991b95
parent 27ecf2e10218c110e3559d14614856b7a62b140b
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Thu, 30 Mar 2023 18:09:36 +0200

Upgraded TLS: fixed inefficient communication

Diffstat:
Msrc/microhttpd/response.c | 15++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c @@ -2045,13 +2045,26 @@ MHD_response_execute_upgrade_ (struct MHD_Response *response, free (urh); return MHD_NO; } + pool = connection->pool; + if (0 != connection->write_buffer_size) + { + mhd_assert (NULL != connection->write_buffer); + /* All data should be sent already */ + mhd_assert (connection->write_buffer_send_offset == \ + connection->write_buffer_append_offset); + (void) MHD_pool_reallocate (pool, connection->write_buffer, + connection->write_buffer_size, 0); + connection->write_buffer_append_offset = 0; + connection->write_buffer_send_offset = 0; + connection->write_buffer_size = 0; + } + connection->write_buffer = NULL; urh->app.socket = sv[0]; urh->app.urh = urh; urh->app.celi = MHD_EPOLL_STATE_UNREADY; urh->mhd.socket = sv[1]; urh->mhd.urh = urh; urh->mhd.celi = MHD_EPOLL_STATE_UNREADY; - pool = connection->pool; avail = MHD_pool_get_free (pool); if (avail < RESERVE_EBUF_SIZE) {