Fixes problems with server reflexives address checks (as all local candidates has their own ufrag we will not remove server reflexive candidates when pruning checklists. Handles STALE_CREDENTIALS error due to checks being sent too quickly to a remote peer that does not process candidates IQ yet.

This commit is contained in:
seb 2011-06-10 14:06:05 +00:00
parent 16617e7234
commit c91bfae9b0
4 changed files with 40 additions and 17 deletions

View File

@ -210,7 +210,8 @@ public class ErrorCodeAttribute extends Attribute
/** /**
* Sets this error's error class. * Sets this error's error class.
* @param errorClass this error's error class. * @param errorClass this error's error class.
* @throws IllegalArgumentException if errorClass is not a valid error class. * @throws IllegalArgumentException if errorClass is not a valid error
* class.
*/ */
public void setErrorClass(byte errorClass) public void setErrorClass(byte errorClass)
throws IllegalArgumentException throws IllegalArgumentException

View File

@ -1193,7 +1193,8 @@ public class Agent
CandidatePair pair = findCandidatePair(localUFrag, remoteUFrag); CandidatePair pair = findCandidatePair(localUFrag, remoteUFrag);
if(pair == null) if(pair == null)
{ {
logger.info("No GTalk CandidatePair that match Lufrag/Rufrag"); logger.info("No GTalk CandidatePair that match Lufrag/Rufrag" +
" " + localUFrag + " " + remoteUFrag);
return; return;
} }

View File

@ -603,9 +603,14 @@ class ConnectivityCheckClient
Response response = evt.getResponse(); Response response = evt.getResponse();
Request originalRequest = evt.getRequest(); Request originalRequest = evt.getRequest();
char errorCode ErrorCodeAttribute errorAttr = (ErrorCodeAttribute)response.
= ((ErrorCodeAttribute) response.getAttribute(Attribute.ERROR_CODE)) getAttribute(Attribute.ERROR_CODE);
.getErrorCode(); // GTalk error code is not RFC3489/RFC5389 compliant
// example: 400 becomes 0x01 0x90 with GTalk
// RFC3489/RFC5389 gives 0x04 0x00
int cl = errorAttr.getErrorClass();
int co = errorAttr.getErrorNumber() & 0xff;
char errorCode = errorAttr.getErrorCode();
CandidatePair pair = ((CandidatePair)evt.getTransactionID() CandidatePair pair = ((CandidatePair)evt.getTransactionID()
.getApplicationData()); .getApplicationData());
@ -624,6 +629,19 @@ class ConnectivityCheckClient
pair.getParentComponent().getParentStream().getCheckList() pair.getParentComponent().getParentStream().getCheckList()
.scheduleTriggeredCheck(pair); .scheduleTriggeredCheck(pair);
} }
else if(parentAgent.getCompatibilityMode() == CompatibilityMode.GTALK &&
cl == 1 && co == 0xae) // STALE_CREDENTIALS (430)
{
// it may be an error due to remote peer that does not processed
// our candidates IQ and we start connectivity checks too quickly
//(that's why we get a STALE CREDENTIALS because remote peer doesn't
// know the candidate ufrag). So let's send another check for that
// pair
logger.info("stale credentials for GTalk check for " +
pair.toShortString());
startCheckForPair(pair);
return;
}
else else
{ {
logger.fine("Received an unrecoverable error response for pair " logger.fine("Received an unrecoverable error response for pair "

View File

@ -410,6 +410,8 @@ public class IceMediaStream
continue; continue;
} }
if(parentAgent.getCompatibilityMode() == CompatibilityMode.RFC5245)
{
//replace local server reflexive candidates with their base. //replace local server reflexive candidates with their base.
LocalCandidate localCnd = pair.getLocalCandidate(); LocalCandidate localCnd = pair.getLocalCandidate();
if( localCnd.getType() if( localCnd.getType()
@ -425,6 +427,7 @@ public class IceMediaStream
continue; continue;
} }
} }
}
tmpCheckList.add(pair); tmpCheckList.add(pair);
} }