8000 [core] Fix incorrectly updated epoll flags in case of group accept by ethouris · Pull Request #3181 · Haivision/srt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[core] Fix incorrectly updated epoll flags in case of group accept #3181

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

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

ethouris
Copy link
Collaborator

The previous fix for the pending groups was done incorrectly. The problem is that even if the group is pending, it should still keep the UPDATE state on every listener that provided FURTHER group member sockets.

Instead of the m_bPending flag, now it's providing the group with the list of listener sockets which at the moment have any pending member sockets that are members of this group. This way every single listener socket is set the UPDATE flag if it contained any second and next sockets pending for this group.

The situation is happening in case when you have multiple connections reporting at once and all of them for a moment remain the pending sockets. In this case every single listener socket that provided the socket for this group should keep it queued and report read-ready state (no matter that only one of them can effectively deliver the group). Once the srt_accept is called for any of the listeners that reported it, the first found group member socket is extracted from the queue, but the reported socket is replaced with the group ID. This time however all listener sockets are reviewed to check if any of them have more queued sockets and:

  • If there are any queued sockets that are members of the same group, this listener socket should be set UPDATE flag
  • If there are any queued sockets that are not members of this group, the listener socket should remain readable, otherwise the IN flag is cleared.

IMPORTANT: The very first listener that gets the reported-in connection for a group, as it CREATES the mirror group at the listener side, adds this listener to the pending listeners in the group. Any next such connection request adds the listener to this list ONLY IF AT LEAST ONE SOCKET IS THERE ALREADY (otherwise it means that the group wasn't pending and the socket is not queued). After the call to accept, this list is cleared.

@ethouris ethouris added this to the v1.6.0 milestone Jun 19, 2025
@ethouris ethouris added Type: Bug Indicates an unexpected problem or unintended behavior [core] Area: Changes in SRT library core labels Jun 19, 2025
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: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0