Skip to content
Snippets Groups Projects
Commit 8f35361a authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud
Browse files

connectionManager: fix answerTo logic

Previous answerTo's logic was weird. hasPublicIp() should be
unnecessary here and we should send remote candidates when
gathered (before ice->start).

Change-Id: I3dc9466a1979878e5557fc7dd05cee6049935523
parent 19702b7c
No related branches found
No related tags found
No related merge requests found
...@@ -611,7 +611,7 @@ ConnectionManager::Impl::onRequestStartIce(const PeerConnectionRequest& req) ...@@ -611,7 +611,7 @@ ConnectionManager::Impl::onRequestStartIce(const PeerConnectionRequest& req)
} }
auto sdp = IceTransport::parse_SDP(req.ice_msg, *ice); auto sdp = IceTransport::parse_SDP(req.ice_msg, *ice);
auto hasPubIp = hasPublicIp(sdp); answerTo(*ice, req.id, req.from);
if (not ice->startIce({sdp.rem_ufrag, sdp.rem_pwd}, sdp.rem_candidates)) { if (not ice->startIce({sdp.rem_ufrag, sdp.rem_pwd}, sdp.rem_candidates)) {
JAMI_ERR("[Account:%s] start ICE failed - fallback to TURN", account.getAccountID().c_str()); JAMI_ERR("[Account:%s] start ICE failed - fallback to TURN", account.getAccountID().c_str());
ice = nullptr; ice = nullptr;
...@@ -619,9 +619,6 @@ ConnectionManager::Impl::onRequestStartIce(const PeerConnectionRequest& req) ...@@ -619,9 +619,6 @@ ConnectionManager::Impl::onRequestStartIce(const PeerConnectionRequest& req)
connReadyCb_(req.from, "", nullptr); connReadyCb_(req.from, "", nullptr);
return; return;
} }
if (hasPubIp)
answerTo(*ice, req.id, req.from);
} }
void void
...@@ -640,11 +637,6 @@ ConnectionManager::Impl::onRequestOnNegoDone(const PeerConnectionRequest& req) ...@@ -640,11 +637,6 @@ ConnectionManager::Impl::onRequestOnNegoDone(const PeerConnectionRequest& req)
return; return;
} }
auto sdp = IceTransport::parse_SDP(req.ice_msg, *ice);
auto hasPubIp = hasPublicIp(sdp);
if (!hasPubIp)
answerTo(*ice, req.id, req.from);
// Build socket // Build socket
auto endpoint = std::make_unique<IceSocketEndpoint>(std::shared_ptr<IceTransport>( auto endpoint = std::make_unique<IceSocketEndpoint>(std::shared_ptr<IceTransport>(
std::move(ice)), std::move(ice)),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment