From 5e7a675009c8e37a37f9c80d1b612daaa4f51db4 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Wed, 18 Mar 2020 11:58:27 +0100 Subject: [PATCH] JsonRpcConnection#HandleAndWriteHeartbeats(): check !!#m_Endpoint --- lib/remote/jsonrpcconnection-heartbeat.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/remote/jsonrpcconnection-heartbeat.cpp b/lib/remote/jsonrpcconnection-heartbeat.cpp index 993877e4e..ee29d47e1 100644 --- a/lib/remote/jsonrpcconnection-heartbeat.cpp +++ b/lib/remote/jsonrpcconnection-heartbeat.cpp @@ -28,9 +28,17 @@ void JsonRpcConnection::HandleAndWriteHeartbeats(boost::asio::yield_context yc) } if (m_NextHeartbeat != 0 && m_NextHeartbeat < Utility::GetTime()) { - Log(LogWarning, "JsonRpcConnection") - << "Client for endpoint '" << m_Endpoint->GetName() << "' has requested " - << "heartbeat message but hasn't responded in time. Closing connection."; + { + Log logMsg (LogWarning, "JsonRpcConnection"); + + if (m_Endpoint) { + logMsg << "Client for endpoint '" << m_Endpoint->GetName() << "'"; + } else { + logMsg << "Anonymous client"; + } + + logMsg << " has requested heartbeat message but hasn't responded in time. Closing connection."; + } Disconnect(); break;