From 4e618175c72ce44391d9bc57cb4ea761d85dd21e Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 16 Mar 2019 17:42:21 -0700 Subject: [PATCH] modules/client/sync: Try to ensure all next_batch tokens are limited to the upper bound. --- modules/client/sync.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/client/sync.cc b/modules/client/sync.cc index a63082ff3..2a942ec90 100644 --- a/modules/client/sync.cc +++ b/modules/client/sync.cc @@ -380,7 +380,7 @@ try last && completed? data.range.second: last? - last + 1: + std::min(last + 1, data.range.second): 0UL }; @@ -651,7 +651,7 @@ ircd::m::sync::longpoll::handle(data &data, const auto next { data.event_idx? - data.event_idx + 1: + std::min(data.event_idx + 1, vm::current_sequence + 1): data.range.first };