-
Notifications
You must be signed in to change notification settings - Fork 861
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
Fix a problem when a connection is rejected when the last handshake was missed #471
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…his caused a deadlock if the triggering engine is being thread-joined.
ethouris
added
Priority: High
Type: Bug
Indicates an unexpected problem or unintended behavior
Status: In Progress
labels
Jan 21, 2019
…nto dev-fix-connect-confusion
…-connect-confusion
ethouris
added
Status: Blocked
[core]
Area: Changes in SRT library core
and removed
Status: In Progress
labels
Mar 29, 2019
BLOCKED BY: #504 |
BLOCKING #504 merged. |
maxsharabayko
approved these changes
Jun 2, 2019
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
Priority: High
Type: Bug
Indicates an unexpected problem or unintended behavior
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the caller-listener configuration, the socket that is currently in the handshake (connecting) state expects only handshake messages to be received.
In a situation that the conclusion handshake was sent from a caller to a listener, the listener interprets it and turns into a connected state, with sending the last conclusion handshake response to the caller, then it states the caller is now connected and the application gets the accepted socket and can use it for sending data. However, if this last handshake was lost, the socket on the caller side is still in connecting state and receiving data packets (or anything else than handshake) makes it confused. The 1.3.0 version introduced a bug that in a situation like this makes the connection rejected.
The fix is to recognize this situation properly and make the caller repeat sending the last conclusion handshake, until the conclusion handshake response is finally received from the listener. Of course, any packets received from the listener would have to be ignored and the listener needs to repeat them.
This fix also contains a possibility to forcefully simulate this particular packet to be lost by defining the
TEST_DISABLE_FINAL_HANDSHAKE
macro (also through./configure --srt-extra-cflags=-DTEST_DISABLE_FINAL_HANDSHAKE
).