mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-13 21:27:21 +02:00
Merge pull request #14157 from SimonWalton-HiFi/domain-checkin-limit
Cap the number of domain-server duplicate check-ins sent upon retransmission
This commit is contained in:
commit
219302a9b6
1 changed files with 2 additions and 0 deletions
|
@ -427,8 +427,10 @@ void NodeList::sendDomainServerCheckIn() {
|
|||
flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::SendDSCheckIn);
|
||||
|
||||
// Send duplicate check-ins in the exponentially increasing sequence 1, 1, 2, 4, ...
|
||||
static const int MAX_CHECKINS_TOGETHER = 20;
|
||||
int outstandingCheckins = _domainHandler.getCheckInPacketsSinceLastReply();
|
||||
int checkinCount = outstandingCheckins > 1 ? std::pow(2, outstandingCheckins - 2) : 1;
|
||||
checkinCount = std::min(checkinCount, MAX_CHECKINS_TOGETHER);
|
||||
for (int i = 1; i < checkinCount; ++i) {
|
||||
auto packetCopy = domainPacket->createCopy(*domainPacket);
|
||||
sendPacket(std::move(packetCopy), _domainHandler.getSockAddr());
|
||||
|
|
Loading…
Reference in a new issue