Avoid loops by setting end to an empty string if start == end

This commit is contained in:
Till Faelligen 2023-07-08 11:25:18 +02:00
parent b965a08faa
commit 6f4922a69d
No known key found for this signature in database
GPG key ID: ACCDC9606D472758

View file

@ -250,6 +250,12 @@ func OnIncomingMessagesRequest(
}
}
// If start and end are equal, we either reached the beginning or something else
// is wrong. To avoid endless loops from clients, set end to 0 an empty string
if start == end {
end = types.TopologyToken{}
}
util.GetLogger(req.Context()).WithFields(logrus.Fields{
"from": from.String(),
"to": to.String(),