Fixes Google's ICE with TCP transport.

This commit is contained in:
seb 2011-10-12 15:11:19 +00:00
parent fab4966215
commit 338409c769
2 changed files with 23 additions and 3 deletions

View File

@ -340,6 +340,18 @@ public class Component
{
if(localCnd.canReach(remoteCnd))
{
if(localCnd.getTransport() == Transport.TCP &&
localCnd.getIceSocketWrapper().getTCPSocket().
isConnected())
{
if(!localCnd.getIceSocketWrapper().getTCPSocket().
getRemoteSocketAddress().equals(
remoteCnd.getTransportAddress()))
{
continue;
}
}
CandidatePair pair = new CandidatePair(localCnd,
remoteCnd);
logger.info("new Pair added: " + pair.toShortString());

View File

@ -189,6 +189,8 @@ class ConnectivityCheckClient
//nominated pairs.
if(candidatePair.isNominated())
{
logger.info("set useCandidateSent for " +
candidatePair.toShortString());
candidatePair.setUseCandidateSent();
}
}
@ -517,8 +519,13 @@ class ConnectivityCheckClient
.getAttribute(Attribute.USERNAME);
String username = new String(uname.getUsername());
String ufrag = username.substring(16, 32);
validLocalCandidate = parentAgent.findLocalCandidate(mappedAddress,
ufrag);
if(mappedAddress.getTransport() == Transport.TCP)
validLocalCandidate = parentAgent.findLocalCandidate(
mappedAddress);
else
validLocalCandidate = parentAgent.findLocalCandidate(
mappedAddress, ufrag);
}
else if(parentAgent.getCompatibilityMode() == CompatibilityMode.RFC5245)
{
@ -666,7 +673,8 @@ class ConnectivityCheckClient
logger.info("IsControlling: " + parentAgent.isControlling() +
" USE-CANDIDATE:" +
request.containsAttribute(Attribute.USE_CANDIDATE));
(request.containsAttribute(Attribute.USE_CANDIDATE) ||
checkedPair.useCandidateSent()));
//If the agent was a controlling agent, and it had included a USE-
//CANDIDATE attribute in the Binding request, the valid pair generated