[core] Fixed packet retransmission #690
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When trying to re-transmit a packet from the
m_pSndLossList
(a packet considered or reported lost), but later on was yet acknowledged, the sending functionpackData()
returns and does not reschedule the sending queue for next operation. Instead it goes into waiting for some event that is expected to change the sending buffer state (e.g. ACK).Instead the processing in
packData()
should go further through the list of reported lost packets or end up sending a new packet from the buffer.Important thing is locking of
m_AckLock
beforem_pSndLossList->getLostSeq()
. Previouslym_pSndLossList->getLostSeq()
was called, and only after it them_AckLock
was locked, therefore the state ofm_pSndLossList
could have changed between those calls.This PR adds the
CUDT::packLostData()
function that iterates through packets in the loss list and tries to construct an SRT packet. On success the payload size is returned. If it fails to construct a retransmission packet, then 0 is returned, it the parent functionpackData()
tries to prepare a new packet for sending.