diff --git a/src/ice_transport.cpp b/src/ice_transport.cpp index 9906b028d502bfc734f54356a2ad8a8b548257a3..c9c530f8295094cc38c788c86a418c9fd41dcd76 100644 --- a/src/ice_transport.cpp +++ b/src/ice_transport.cpp @@ -333,12 +333,6 @@ IceTransport::Impl::Impl(const char* name, const IceTransportOptions& options) config_.turn.conn_type = PJ_TURN_TP_UDP; } - if (options.aggressive) { - config_.opt.aggressive = PJ_TRUE; - } else { - config_.opt.aggressive = PJ_FALSE; - } - addDefaultCandidates(); // Note: For server reflexive candidates, UPNP mappings will @@ -626,14 +620,15 @@ IceTransport::Impl::link() const std::ostringstream out; for (unsigned strm = 0; strm < streamsCount_; strm++) { for (unsigned i = 1; i <= compCountPerStream_; i++) { - auto laddr = getLocalAddress(strm * streamsCount_ + i); - auto raddr = getRemoteAddress(strm * streamsCount_ + i); + auto absIdx = strm * streamsCount_ + i; + auto laddr = getLocalAddress(absIdx); + auto raddr = getRemoteAddress(absIdx); if (laddr and raddr) { out << " [" << i << "] " << laddr.toString(true, true) << " [" - << getCandidateType(getSelectedCandidate(i, false)) << "] " + << getCandidateType(getSelectedCandidate(absIdx, false)) << "] " << " <-> " << raddr.toString(true, true) << " [" - << getCandidateType(getSelectedCandidate(i, true)) << "] " << '\n'; + << getCandidateType(getSelectedCandidate(absIdx, true)) << "] " << '\n'; } else { out << " [" << i << "] disabled\n"; } @@ -1774,7 +1769,10 @@ IceTransportFactory::IceTransportFactory() // Using 500ms with default PJ_STUN_MAX_TRANSMIT_COUNT (7) gives around 33s before timeout. ice_cfg_.stun_cfg.rto_msec = 500; - ice_cfg_.opt.aggressive = PJ_TRUE; + // See https://tools.ietf.org/html/rfc5245#section-8.1.1.2 + // If enabled, it may help speed-up the connectivity, but may cause + // the nomination of sub-optimal pairs. + ice_cfg_.opt.aggressive = PJ_FALSE; } IceTransportFactory::~IceTransportFactory() {} diff --git a/src/ice_transport.h b/src/ice_transport.h index 25b301961722ccc2080f1ff5c4c9f6f0558aa774..8326ec81539fcf5a0e3fc027d94cdf45dd175057 100644 --- a/src/ice_transport.h +++ b/src/ice_transport.h @@ -103,10 +103,7 @@ struct IceTransportOptions IceTransportCompleteCb onNegoDone {}; std::vector<StunServerInfo> stunServers; std::vector<TurnServerInfo> turnServers; - bool tcpEnable {false}; // If we want to use TCP - // See https://tools.ietf.org/html/rfc5245#section-8.1.1.2 - // Make negotiation aggressive by default to avoid latencies. - bool aggressive {true}; + bool tcpEnable {false}; // Addresses used by the account owning the transport instance. IpAddr accountLocalAddr {}; IpAddr accountPublicAddr {};