diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2023-03-30 18:09:36 +0200 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2023-03-30 18:36:14 +0200 |
commit | 6b5e509ff088d05c1033c6773169d8d001991b95 (patch) | |
tree | 9416de7e3e359f36f49c8ffcf1daf1d7d91ab233 | |
parent | 27ecf2e10218c110e3559d14614856b7a62b140b (diff) | |
download | libmicrohttpd-6b5e509ff088d05c1033c6773169d8d001991b95.tar.gz libmicrohttpd-6b5e509ff088d05c1033c6773169d8d001991b95.zip |
Upgraded TLS: fixed inefficient communication
-rw-r--r-- | src/microhttpd/response.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c index f0ca7825..fc006da2 100644 --- a/src/microhttpd/response.c +++ b/src/microhttpd/response.c | |||
@@ -2045,13 +2045,26 @@ MHD_response_execute_upgrade_ (struct MHD_Response *response, | |||
2045 | free (urh); | 2045 | free (urh); |
2046 | return MHD_NO; | 2046 | return MHD_NO; |
2047 | } | 2047 | } |
2048 | pool = connection->pool; | ||
2049 | if (0 != connection->write_buffer_size) | ||
2050 | { | ||
2051 | mhd_assert (NULL != connection->write_buffer); | ||
2052 | /* All data should be sent already */ | ||
2053 | mhd_assert (connection->write_buffer_send_offset == \ | ||
2054 | connection->write_buffer_append_offset); | ||
2055 | (void) MHD_pool_reallocate (pool, connection->write_buffer, | ||
2056 | connection->write_buffer_size, 0); | ||
2057 | connection->write_buffer_append_offset = 0; | ||
2058 | connection->write_buffer_send_offset = 0; | ||
2059 | connection->write_buffer_size = 0; | ||
2060 | } | ||
2061 | connection->write_buffer = NULL; | ||
2048 | urh->app.socket = sv[0]; | 2062 | urh->app.socket = sv[0]; |
2049 | urh->app.urh = urh; | 2063 | urh->app.urh = urh; |
2050 | urh->app.celi = MHD_EPOLL_STATE_UNREADY; | 2064 | urh->app.celi = MHD_EPOLL_STATE_UNREADY; |
2051 | urh->mhd.socket = sv[1]; | 2065 | urh->mhd.socket = sv[1]; |
2052 | urh->mhd.urh = urh; | 2066 | urh->mhd.urh = urh; |
2053 | urh->mhd.celi = MHD_EPOLL_STATE_UNREADY; | 2067 | urh->mhd.celi = MHD_EPOLL_STATE_UNREADY; |
2054 | pool = connection->pool; | ||
2055 | avail = MHD_pool_get_free (pool); | 2068 | avail = MHD_pool_get_free (pool); |
2056 | if (avail < RESERVE_EBUF_SIZE) | 2069 | if (avail < RESERVE_EBUF_SIZE) |
2057 | { | 2070 | { |