diff --git a/src/network/rest/http/ClientConnection.h b/src/network/rest/http/ClientConnection.h index 2b9ddb18..a4f790d2 100644 --- a/src/network/rest/http/ClientConnection.h +++ b/src/network/rest/http/ClientConnection.h @@ -40,6 +40,7 @@ #include "Defines.h" #include "network/rest/http/HTTPLexer.h" #include "network/rest/http/HTTPPayload.h" +#include "Log.h" #include "Utils.h" #include @@ -135,6 +136,9 @@ namespace network } } else if (ec != asio::error::operation_aborted) { + if (ec) { + ::LogError(LOG_REST, "%s, code = %u", ec.message().c_str(), ec.value()); + } stop(); } }); @@ -152,6 +156,8 @@ namespace network { asio::error_code ec = e.code(); if (ec) { + ::LogError(LOG_REST, "%s, code = %u", ec.message().c_str(), ec.value()); + // initiate graceful connection closure asio::error_code ignored_ec; m_socket.shutdown(asio::ip::tcp::socket::shutdown_both, ignored_ec); diff --git a/src/network/rest/http/ServerConnection.h b/src/network/rest/http/ServerConnection.h index 93981b80..0daef7b9 100644 --- a/src/network/rest/http/ServerConnection.h +++ b/src/network/rest/http/ServerConnection.h @@ -40,6 +40,7 @@ #include "Defines.h" #include "network/rest/http/HTTPLexer.h" #include "network/rest/http/HTTPPayload.h" +#include "Log.h" #include "Utils.h" #include @@ -138,6 +139,9 @@ namespace network } } else if (ec != asio::error::operation_aborted) { + if (ec) { + ::LogError(LOG_REST, "%s, code = %u", ec.message().c_str(), ec.value()); + } m_connectionManager.stop(this->shared_from_this()); } }); @@ -170,6 +174,9 @@ namespace network } if (ec != asio::error::operation_aborted) { + if (ec) { + ::LogError(LOG_REST, "%s, code = %u", ec.message().c_str(), ec.value()); + } m_connectionManager.stop(this->shared_from_this()); } }