mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 23:24:09 +02:00
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;
|
String message;
|
||||||
while (true) {
|
while (true) {
|
||||||
|
Dictionary::Ptr pmessage;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!NetString::ReadStringFromStream(lstream, &message))
|
if (!NetString::ReadStringFromStream(lstream, &message))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
pmessage = Value::Deserialize(message);
|
||||||
} catch (std::exception&) {
|
} catch (std::exception&) {
|
||||||
Log(LogWarning, "cluster", "Unexpected end-of-file for cluster log: " + path);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Dictionary::Ptr pmessage = Value::Deserialize(message);
|
|
||||||
|
|
||||||
if (pmessage->Get("timestamp") < peer_ts)
|
if (pmessage->Get("timestamp") < peer_ts)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user