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

Skip ice candidate if peer and stream objects are NULL #1534

Merged
merged 8 commits into from
Feb 17, 2020
Merged

Skip ice candidate if peer and stream objects are NULL #1534

merged 8 commits into from
Feb 17, 2020

Conversation

vpoddubchak
Copy link
Contributor

This PR is a workaround of crash which sometimes happens when iOS client tries to connect to the room. In some cases peer and stream objects are NULL (possible because of race condition) in moment then method nicer->IcePeerContextParseTrickleCandidate is calling.
In cases when skipped ice-candidate is host - all will be OK: connection will be established. But I'm afraid that in cases when we skip srflx candidate it can bring to connection problems. Anyway it is better than crash of the room...

Call setRemoteCandidates twice to test using of start_future_ in 2 cases: first time and next times.
@vpoddubchak
Copy link
Contributor Author

Tests passed only when I allow using peer_ variable only after startSync() has been done (synced by start_promise_).
I think this is a fix.

@@ -320,6 +320,16 @@ void NicerConnection::startGathering() {
}

bool NicerConnection::setRemoteCandidates(const std::vector<CandidateInfo> &candidates, bool is_bundle) {
// At this moment we should have peer_ initalized. To make sure, we are waiting for start_promise_ there
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we make sure we don't call setRemoteCandidates before having started Nicer? I don't like the idea of blocking the thread while we are waiting. Another alternative is to return false and call setRemoteCandidates after a while again.

Copy link
Contributor

@jcague jcague left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good, thanks for the contribution @vpoddubchak

@jcague jcague merged commit a1bc273 into lynckia:master Feb 17, 2020
@jcague jcague mentioned this pull request Apr 15, 2020
Arri98 pushed a commit to Arri98/licode that referenced this pull request Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants