mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 19:04:32 +02:00
only send second packet of pair when required
This commit is contained in:
parent
2a8250ced5
commit
6c9021c288
1 changed files with 3 additions and 1 deletions
|
@ -443,10 +443,12 @@ bool SendQueue::maybeSendNewPacket() {
|
|||
_packets.pop_front();
|
||||
|
||||
std::unique_ptr<Packet> secondPacket;
|
||||
bool shouldSendPairTail = false;
|
||||
|
||||
if (((uint32_t) nextNumber & 0xF) == 0) {
|
||||
// the first packet is the first in a probe pair - every 16 (rightmost 16 bits = 0) packets
|
||||
// pull off a second packet if we can before we unlock
|
||||
shouldSendPairTail = true;
|
||||
|
||||
if (_packets.size() > 0) {
|
||||
secondPacket.swap(_packets.front());
|
||||
|
@ -463,7 +465,7 @@ bool SendQueue::maybeSendNewPacket() {
|
|||
// do we have a second in a pair to send as well?
|
||||
if (secondPacket) {
|
||||
sendNewPacketAndAddToSentList(move(secondPacket), getNextSequenceNumber());
|
||||
} else {
|
||||
} else if (shouldSendPairTail) {
|
||||
// we didn't get a second packet to send in the probe pair
|
||||
// send a control packet of type ProbePairTail so the receiver can still do
|
||||
// proper bandwidth estimation
|
||||
|
|
Loading…
Reference in a new issue