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:
parent
16617e7234
commit
c91bfae9b0
@ -210,14 +210,15 @@ public class ErrorCodeAttribute extends Attribute
|
||||
/**
|
||||
* Sets 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)
|
||||
throws IllegalArgumentException
|
||||
{
|
||||
if(errorClass < 0 || errorClass > 99)
|
||||
throw new IllegalArgumentException(
|
||||
errorClass + " is not a valid error number!");
|
||||
errorClass + " is not a valid error number!");
|
||||
this.errorClass = errorClass;
|
||||
}
|
||||
|
||||
|
||||
@ -1193,7 +1193,8 @@ public class Agent
|
||||
CandidatePair pair = findCandidatePair(localUFrag, remoteUFrag);
|
||||
if(pair == null)
|
||||
{
|
||||
logger.info("No GTalk CandidatePair that match Lufrag/Rufrag");
|
||||
logger.info("No GTalk CandidatePair that match Lufrag/Rufrag" +
|
||||
" " + localUFrag + " " + remoteUFrag);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -603,9 +603,14 @@ class ConnectivityCheckClient
|
||||
Response response = evt.getResponse();
|
||||
Request originalRequest = evt.getRequest();
|
||||
|
||||
char errorCode
|
||||
= ((ErrorCodeAttribute) response.getAttribute(Attribute.ERROR_CODE))
|
||||
.getErrorCode();
|
||||
ErrorCodeAttribute errorAttr = (ErrorCodeAttribute)response.
|
||||
getAttribute(Attribute.ERROR_CODE);
|
||||
// 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()
|
||||
.getApplicationData());
|
||||
@ -624,6 +629,19 @@ class ConnectivityCheckClient
|
||||
pair.getParentComponent().getParentStream().getCheckList()
|
||||
.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
|
||||
{
|
||||
logger.fine("Received an unrecoverable error response for pair "
|
||||
|
||||
@ -410,19 +410,22 @@ public class IceMediaStream
|
||||
continue;
|
||||
}
|
||||
|
||||
//replace local server reflexive candidates with their base.
|
||||
LocalCandidate localCnd = pair.getLocalCandidate();
|
||||
if( localCnd.getType()
|
||||
== CandidateType.SERVER_REFLEXIVE_CANDIDATE)
|
||||
if(parentAgent.getCompatibilityMode() == CompatibilityMode.RFC5245)
|
||||
{
|
||||
pair.setLocalCandidate(localCnd.getBase());
|
||||
|
||||
//if the new pair corresponds to another one with a higher
|
||||
//priority, then remove it.
|
||||
if(tmpCheckList.contains(pair))
|
||||
//replace local server reflexive candidates with their base.
|
||||
LocalCandidate localCnd = pair.getLocalCandidate();
|
||||
if( localCnd.getType()
|
||||
== CandidateType.SERVER_REFLEXIVE_CANDIDATE)
|
||||
{
|
||||
ckListIter.remove();
|
||||
continue;
|
||||
pair.setLocalCandidate(localCnd.getBase());
|
||||
|
||||
//if the new pair corresponds to another one with a higher
|
||||
//priority, then remove it.
|
||||
if(tmpCheckList.contains(pair))
|
||||
{
|
||||
ckListIter.remove();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user