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 final HS dispatch to already accepted socket with the lack of listener #1690

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

ethouris
Copy link
Collaborator

@ethouris ethouris commented Dec 2, 2020

Fixes #1648

Problem: if the listener side closes the listener socket immediately after returning from srt_accept, but the caller side has missed the conclusion handshake from the listener, this is the situation:

  • The listener side thinks it's connected (accepted socket already received and ready to use)
  • The caller side missed the conclusion handshake, so it thinks of itself as being still in the induction phase and still awaits the conclusion message from the listener side and repeatedly sends conclusion requests
  • The conclusion request from the caller could not be dispatched to anyone because the listener socket is now closed and there's also no rendezvous socket. Therefore this message is rejected. In result the caller side times out, and so does the listener side.

To fix:

  1. The registered connector has now also information about the peer socket ID so that registered connectors can be also searched by peer socket ID.
  2. In case of absence of the listener, and target ID being 0 (connection request), the declared ID (peer id in this context) is being searched for peer IDs and therefore any existing socket that declares itself being connected to this peer. If found, this socket is requested to construct and send the HS conclusion response.

If any of these conclusion messages finally reach the caller side, the caller will finally consider itself connected.

@ethouris ethouris added [core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior labels Dec 2, 2020
@codecov

This comment has been minimized.

srtcore/core.cpp Fixed Show fixed Hide fixed
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.

[BUG] Connection failure if handshake conclusion response is lost
1 participant