From 565735c3c50c9a8f2ee0185b637c9290b7ebec48 Mon Sep 17 00:00:00 2001 From: Viacheslav Demydiuk Date: Mon, 6 Oct 2025 12:07:41 +0300 Subject: [PATCH] MtService: fixed crash on disconnect last expert in MT terminal --- MtService/MtConnection.cpp | 6 ++++++ MtService/MtConnection.h | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/MtService/MtConnection.cpp b/MtService/MtConnection.cpp index 14dbeb8c..9b7805a9 100755 --- a/MtService/MtConnection.cpp +++ b/MtService/MtConnection.cpp @@ -107,6 +107,12 @@ void MtConnection::OnRead( return; } + if (ec == boost::asio::error::eof) + { + log_.Info("%s: %s. Remote peer gracefully closes the connection.", __FUNCTION__, ec.message().c_str()); + return; + } + if (ec) { log_.Error("%s: %s", __FUNCTION__, ec.message().c_str()); diff --git a/MtService/MtConnection.h b/MtService/MtConnection.h index e27e0dbd..4f85afae 100755 --- a/MtService/MtConnection.h +++ b/MtService/MtConnection.h @@ -44,6 +44,5 @@ private: std::string host_; std::string read_text_; boost::beast::flat_buffer read_buffer_; - //std::string send_text_; std::queue send_queue_; };