Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Fixed packet retransmission #690

Merged
merged 1 commit into from
May 16, 2019

Conversation

maxsharabayko
Copy link
Collaborator

@maxsharabayko maxsharabayko commented May 15, 2019

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 function packData() 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 before m_pSndLossList->getLostSeq(). Previously m_pSndLossList->getLostSeq() was called, and only after it the m_AckLock was locked, therefore the state of m_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 function packData() tries to prepare a new packet for sending.

@maxsharabayko maxsharabayko added the [core] Area: Changes in SRT library core label May 15, 2019
@maxsharabayko maxsharabayko added this to the v.1.3.3 milestone May 15, 2019
@maxsharabayko maxsharabayko requested a review from ethouris May 15, 2019 10:51
srtcore/core.cpp Outdated Show resolved Hide resolved
srtcore/core.cpp Outdated Show resolved Hide resolved
srtcore/core.cpp Outdated Show resolved Hide resolved
@maxsharabayko maxsharabayko force-pushed the hotfix/resend_lost_packets branch 2 times, most recently from d2f5bda to 36a8061 Compare May 15, 2019 12:50
srtcore/core.cpp Outdated Show resolved Hide resolved
@maxsharabayko maxsharabayko force-pushed the hotfix/resend_lost_packets branch 2 times, most recently from 11ae527 to e931b61 Compare May 16, 2019 08:51
Do not break sending if a packet in the loss list was ackowledged.
@maxsharabayko maxsharabayko force-pushed the hotfix/resend_lost_packets branch from e931b61 to f11580c Compare May 16, 2019 16:26
@rndi rndi merged commit 25d1dce into Haivision:master May 16, 2019
@maxsharabayko maxsharabayko deleted the hotfix/resend_lost_packets branch July 22, 2019 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants