Fix crash with anonymous clients on certificate signing request and storing sent bytes

refs #5753
This commit is contained in:
Michael Friedrich 2018-02-09 17:18:20 +01:00
parent d578b742ac
commit ad7e801db9
1 changed files with 6 additions and 1 deletions

View File

@ -114,10 +114,15 @@ void JsonRpcConnection::SendMessage(const Dictionary::Ptr& message)
{
try {
ObjectLock olock(m_Stream);
if (m_Stream->IsEof())
return;
size_t bytesSent = JsonRpc::SendMessage(m_Stream, message);
m_Endpoint->AddMessageSent(bytesSent);
if (m_Endpoint)
m_Endpoint->AddMessageSent(bytesSent);
} catch (const std::exception& ex) {
std::ostringstream info;
info << "Error while sending JSON-RPC message for identity '" << m_Identity << "'";