mirror of https://github.com/Icinga/icinga2.git
Fix crash with anonymous clients on certificate signing request and storing sent bytes
refs #5753
This commit is contained in:
parent
d578b742ac
commit
ad7e801db9
|
@ -114,10 +114,15 @@ void JsonRpcConnection::SendMessage(const Dictionary::Ptr& message)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
ObjectLock olock(m_Stream);
|
ObjectLock olock(m_Stream);
|
||||||
|
|
||||||
if (m_Stream->IsEof())
|
if (m_Stream->IsEof())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
size_t bytesSent = JsonRpc::SendMessage(m_Stream, message);
|
size_t bytesSent = JsonRpc::SendMessage(m_Stream, message);
|
||||||
m_Endpoint->AddMessageSent(bytesSent);
|
|
||||||
|
if (m_Endpoint)
|
||||||
|
m_Endpoint->AddMessageSent(bytesSent);
|
||||||
|
|
||||||
} catch (const std::exception& ex) {
|
} catch (const std::exception& ex) {
|
||||||
std::ostringstream info;
|
std::ostringstream info;
|
||||||
info << "Error while sending JSON-RPC message for identity '" << m_Identity << "'";
|
info << "Error while sending JSON-RPC message for identity '" << m_Identity << "'";
|
||||||
|
|
Loading…
Reference in New Issue