From f408f93344334d6e04f783da50eb501a3401bec9 Mon Sep 17 00:00:00 2001 From: "crypro.zoidberg" Date: Mon, 22 Apr 2019 18:43:39 +0200 Subject: [PATCH] be sure that connection is closed on sentque overflow --- contrib/epee/include/net/abstract_tcp_server2.inl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/epee/include/net/abstract_tcp_server2.inl b/contrib/epee/include/net/abstract_tcp_server2.inl index 15ce8441..c59c60e0 100644 --- a/contrib/epee/include/net/abstract_tcp_server2.inl +++ b/contrib/epee/include/net/abstract_tcp_server2.inl @@ -316,6 +316,7 @@ DISABLE_VS_WARNINGS(4355) send_guard.unlock();//manual unlock LOG_ERROR("send to [" << print_connection_context_short(context) << ", (" << (void*)this << ")] que size is more than ABSTRACT_SERVER_SEND_QUE_MAX_COUNT(" << ABSTRACT_SERVER_SEND_QUE_MAX_COUNT << "), shutting down connection"); close(); + shutdown(); return false; } @@ -351,6 +352,8 @@ DISABLE_VS_WARNINGS(4355) template bool connection::shutdown() { + if (m_was_shutdown) + return true; // Initiate graceful connection closure. boost::system::error_code ignored_ec; socket_.shutdown(boost::asio::ip::tcp::socket::shutdown_both, ignored_ec);