Call cancelSending in stopRetransmission

This also removes pending packet from txQueue if it was already in there
This commit is contained in:
GUVWAF 2022-05-07 15:39:14 +02:00
parent c07976438b
commit 348e78718d

View File

@ -151,7 +151,7 @@ bool ReliableRouter::stopRetransmission(GlobalPacketId key)
if (old) { if (old) {
auto numErased = pending.erase(key); auto numErased = pending.erase(key);
assert(numErased == 1); assert(numErased == 1);
packetPool.release(old->packet); cancelSending(getFrom(old->packet), old->packet->id);
return true; return true;
} else } else
return false; return false;