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] Moved ACK sending to CUDT::sendCtrlAck #1628

Merged
merged 2 commits into from
Nov 3, 2020

Conversation

maxsharabayko
Copy link
Collaborator

As a part of the #1610 the ACK sending code was moved to a dedicated function CUDT::sendCtrlAck(..).
The body of the function has no changes except for break statements that are replaced by return.

@maxsharabayko maxsharabayko added Type: Maintenance Work required to maintain or clean up the code [core] Area: Changes in SRT library core labels Oct 27, 2020
@maxsharabayko maxsharabayko added this to the v1.4.3 milestone Oct 27, 2020
srtcore/core.cpp Outdated
if (CSeqNo::seqcmp(ack, m_iRcvLastAck) > 0)
{
const int32_t first_seq ATR_UNUSED = ackDataUpTo(ack);
leaveCS(m_RcvBufferLock);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is now part of the function, I think you might consider changing the lock on m_RcvBuffferLock to use scope-based tools, UniqueLock and InvertedLock. Especially if this is refax and aimed at improving readability and error-resistance.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced critical section with UniqueLock.

Copy link
Collaborator

@ethouris ethouris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider ^^

@maxsharabayko maxsharabayko merged commit bf37de1 into Haivision:master Nov 3, 2020
@maxsharabayko maxsharabayko deleted the develop/send-ctrl-ack branch November 3, 2020 09:27
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 Type: Maintenance Work required to maintain or clean up the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants