Skip to content

Commit

Permalink
Avoid loops by setting end to an empty string if start == end (#3146)
Browse files Browse the repository at this point in the history
  • Loading branch information
S7evinK authored Jul 8, 2023
1 parent b965a08 commit 69b2069
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions syncapi/routing/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 69b2069

Please sign in to comment.