mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-04 00:31:07 +02:00
Merge pull request #9661 from Atlante45/fix/possible-race
Fix possible race condition
This commit is contained in:
commit
a3c123818d
1 changed files with 4 additions and 1 deletions
|
@ -478,6 +478,9 @@ bool SendQueue::maybeResendPacket() {
|
||||||
|
|
||||||
Packet::ObfuscationLevel level = (Packet::ObfuscationLevel)(entry.first < 2 ? 0 : (entry.first - 2) % 4);
|
Packet::ObfuscationLevel level = (Packet::ObfuscationLevel)(entry.first < 2 ? 0 : (entry.first - 2) % 4);
|
||||||
|
|
||||||
|
auto wireSize = resendPacket.getWireSize();
|
||||||
|
auto sequenceNumber = it->first;
|
||||||
|
|
||||||
if (level != Packet::NoObfuscation) {
|
if (level != Packet::NoObfuscation) {
|
||||||
#ifdef UDT_CONNECTION_DEBUG
|
#ifdef UDT_CONNECTION_DEBUG
|
||||||
QString debugString = "Obfuscating packet %1 with level %2";
|
QString debugString = "Obfuscating packet %1 with level %2";
|
||||||
|
@ -512,7 +515,7 @@ bool SendQueue::maybeResendPacket() {
|
||||||
sentLocker.unlock();
|
sentLocker.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
emit packetRetransmitted(resendPacket.getWireSize(), it->first, p_high_resolution_clock::now());
|
emit packetRetransmitted(wireSize, sequenceNumber, p_high_resolution_clock::now());
|
||||||
|
|
||||||
// Signal that we did resend a packet
|
// Signal that we did resend a packet
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue