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

[MAINT] Refax for CSndBuffer::readData to make the call form clearer #2593

Merged
merged 9 commits into from
Jan 24, 2024

Conversation

ethouris
Copy link
Collaborator

This changes the form of CSndBuffer::readData version with offset (intended for retransmission).

The problem with the existing solution was that the CPacket object passed there was used instrumentally to return the information about the sequence number range and message number for dropping. This didn't make any sense because the rule was that if a message retransmission was requested, but the message was qualified as to be dropped instead, the CPacket object wasn't in use at all. But then, when returning -1 as per drop request, the CPacket object was reused to return the message number of the message to be dropped that was written into its MSGNO field, which normally contains the message number AND the flags, but this time it was instrumentally used to just return the message number itself only. Simultaneously the msglen was returned because it was the only way to define the sequence range, while the first sequence from the range was set to the packet.

There has remained only the rule that the CPacket object is first set the message sequence number, and passing CPacket to the call of readData brings in this sequence information. But in case when the call resulted in a drop request, for which there was also defined a specified constant, the drop information is returned exclusively in the dedicated structure, which should be the only information for constructing the UMSG_DROPREQ message contents - the CPacket object is not in use in this case at all, even though it shares some partial information (the beginning sequence number).

There should be no change in the behavior, just the code was made more logically clear.

@ethouris ethouris added Type: Maintenance Work required to maintain or clean up the code [core] Area: Changes in SRT library core labels Dec 23, 2022
@maxsharabayko maxsharabayko added this to the v1.5.2 milestone Dec 23, 2022
srtcore/buffer_snd.h Outdated Show resolved Hide resolved
srtcore/buffer_snd.h Show resolved Hide resolved
@maxsharabayko maxsharabayko merged commit 6e0ab4e into Haivision:master Jan 24, 2024
10 checks passed
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