diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-06-07 12:43:10 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-06-10 19:39:38 +0100 |
commit | 55c7fb87a99cbd89fe2d98de7bde9854ee12b161 (patch) | |
tree | 5640c7b184b57cb3ede100a9f3983337acbc1c2c /contrib/epee/include/net/http_protocol_handler.inl | |
parent | Merge pull request #3866 (diff) | |
download | monero-55c7fb87a99cbd89fe2d98de7bde9854ee12b161.tar.xz |
epee: adaptive connection timeout system
a connection's timeout is halved for every extra connection
from the same host.
Also keep track of when we don't need to use a connection
anymore, so we can close it and free the resource for another
connection.
Also use the longer timeout for non routable local addresses.
Diffstat (limited to 'contrib/epee/include/net/http_protocol_handler.inl')
-rw-r--r-- | contrib/epee/include/net/http_protocol_handler.inl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/epee/include/net/http_protocol_handler.inl b/contrib/epee/include/net/http_protocol_handler.inl index f1da5067a..4ec798232 100644 --- a/contrib/epee/include/net/http_protocol_handler.inl +++ b/contrib/epee/include/net/http_protocol_handler.inl @@ -399,7 +399,7 @@ namespace net_utils template<class t_connection_context> bool simple_http_connection_handler<t_connection_context>::analize_cached_request_header_and_invoke_state(size_t pos) { - //LOG_PRINT_L4("HTTP HEAD:\r\n" << m_cache.substr(0, pos)); + LOG_PRINT_L3("HTTP HEAD:\r\n" << m_cache.substr(0, pos)); m_query_info.m_full_request_buf_size = pos; m_query_info.m_request_head.assign(m_cache.begin(), m_cache.begin()+pos); @@ -582,6 +582,7 @@ namespace net_utils m_psnd_hndlr->do_send((void*)response_data.data(), response_data.size()); if ((response.m_body.size() && (query_info.m_http_method != http::http_method_head)) || (query_info.m_http_method == http::http_method_options)) m_psnd_hndlr->do_send((void*)response.m_body.data(), response.m_body.size()); + m_psnd_hndlr->send_done(); return res; } //----------------------------------------------------------------------------------- |