mirror of
https://github.com/lubosz/overte.git
synced 2025-08-27 11:25:52 +02:00
Merge branch 'atp' of https://github.com/birarda/hifi into protocol
This commit is contained in:
commit
71004ef519
1 changed files with 23 additions and 5 deletions
|
@ -89,10 +89,28 @@ void SendQueue::ack(SequenceNumber ack) {
|
|||
return;
|
||||
}
|
||||
|
||||
// remove any ACKed packets from the map of sent packets
|
||||
QWriteLocker locker(&_sentLock);
|
||||
for (auto seq = _lastAck; seq <= ack; ++seq) {
|
||||
_sentPackets.erase(seq);
|
||||
{
|
||||
// remove any ACKed packets from the map of sent packets
|
||||
QWriteLocker locker(&_sentLock);
|
||||
for (auto seq = _lastAck; seq <= ack; ++seq) {
|
||||
_sentPackets.erase(seq);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
// remove any sequence numbers equal to or lower than this ACK in the loss list
|
||||
QWriteLocker nakLocker(&_naksLock);
|
||||
|
||||
auto it = _naks.begin();
|
||||
|
||||
while (it != _naks.end()) {
|
||||
if (*it <= ack) {
|
||||
it = _naks.erase(it);
|
||||
} else {
|
||||
// the NAKs in the NAK list must be in order, so we can break if we hit one > ack
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_lastAck = ack;
|
||||
|
@ -136,7 +154,7 @@ void SendQueue::sendNextPacket() {
|
|||
}
|
||||
}
|
||||
|
||||
// Find packet in sent list using SeqNum
|
||||
// Find packet in sent list using SequenceNumber
|
||||
if (hasResend) {
|
||||
QWriteLocker locker(&_sentLock);
|
||||
auto it = _sentPackets.find(seqNum);
|
||||
|
|
Loading…
Reference in a new issue