mirror of https://github.com/Icinga/icinga2.git
Fix crash in ClusterListener::ReplayLog().
This commit is contained in:
parent
834f9cd110
commit
b204061d9f
|
@ -443,9 +443,13 @@ void ClusterListener::ReplayLog(const Endpoint::Ptr& endpoint, const Stream::Ptr
|
|||
|
||||
String message;
|
||||
while (true) {
|
||||
Dictionary::Ptr pmessage;
|
||||
|
||||
try {
|
||||
if (!NetString::ReadStringFromStream(lstream, &message))
|
||||
break;
|
||||
|
||||
pmessage = Value::Deserialize(message);
|
||||
} catch (std::exception&) {
|
||||
Log(LogWarning, "cluster", "Unexpected end-of-file for cluster log: " + path);
|
||||
|
||||
|
@ -453,8 +457,6 @@ void ClusterListener::ReplayLog(const Endpoint::Ptr& endpoint, const Stream::Ptr
|
|||
break;
|
||||
}
|
||||
|
||||
Dictionary::Ptr pmessage = Value::Deserialize(message);
|
||||
|
||||
if (pmessage->Get("timestamp") < peer_ts)
|
||||
continue;
|
||||
|
||||
|
|
Loading…
Reference in New Issue