diff options
author | Till <2353100+S7evinK@users.noreply.github.com> | 2023-07-08 11:45:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-08 11:45:44 +0200 |
commit | 69b2069dea160faff6b2b13bb3d660037f12649d (patch) | |
tree | c9592dbc6dc3836ab5bc39c961add9d7c14d247a /syncapi/routing | |
parent | b965a08faa56cd586ba930effed8177661425dbc (diff) |
Avoid loops by setting end to an empty string if start == end (#3146)
Diffstat (limited to 'syncapi/routing')
-rw-r--r-- | syncapi/routing/messages.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/syncapi/routing/messages.go b/syncapi/routing/messages.go index 937e20ad..c3871618 100644 --- a/syncapi/routing/messages.go +++ b/syncapi/routing/messages.go @@ -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(), |