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

Fix a problem when a connection is rejected when the last handshake was missed #471

Merged
merged 41 commits into from
Jun 13, 2019

Conversation

ethouris
Copy link
Collaborator

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).

Mikołaj Małecki and others added 30 commits September 27, 2018 13:25
…his caused a deadlock if the triggering engine is being thread-joined.
@ethouris ethouris added Priority: High Type: Bug Indicates an unexpected problem or unintended behavior Status: In Progress labels Jan 21, 2019
@maxsharabayko maxsharabayko added this to the v.1.3.3 milestone Jan 21, 2019
@ethouris ethouris added Status: Blocked [core] Area: Changes in SRT library core and removed Status: In Progress labels Mar 29, 2019
@ethouris
Copy link
Collaborator Author

BLOCKED BY: #504

@ethouris
Copy link
Collaborator Author

BLOCKING #504 merged.

srtcore/core.cpp Outdated Show resolved Hide resolved
srtcore/core.cpp Show resolved Hide resolved
@rndi rndi merged commit 204352b into Haivision:master Jun 13, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants