CandidatePair can be updated with useCandidateReceived even if the state is not succeeded.

This commit is contained in:
seb 2011-10-10 12:57:51 +00:00
parent 3cc3c94b63
commit fab4966215

View File

@ -1217,7 +1217,8 @@ public class Agent
* {@link org.ice4j.message.Request} contained the USE-CANDIDATE ICE
* attribute.
*/
protected void incomingCheckReceived(TransportAddress remoteAddress,
protected void incomingCheckReceived(
TransportAddress remoteAddress,
TransportAddress localAddress,
long priority,
String remoteUFrag,
@ -1337,6 +1338,10 @@ public class Agent
if (knownPair != null)
{
boolean useCand = false;
useCand = triggerPair.useCandidateReceived();
//if the incoming request contained a USE-CANDIDATE attribute then
//make sure we don't lose this piece of info.
if (triggerPair.useCandidateReceived())
@ -1347,10 +1352,20 @@ public class Agent
//we already know about the remote address so we only need to
//trigger a check for the existing pair
if(compatibilityMode != CompatibilityMode.RFC5245 &&
!isControlling())
{
logger.info("set useCandidateReceived for " +
triggerPair.toShortString());
//next time we will see a request it will be considered as
// having USE-CANDIDATE
triggerPair.setUseCandidateReceived();
}
if (knownPair.getState() == CandidatePairState.SUCCEEDED )
{
//7.2.1.5. Updating the Nominated Flag
if (!isControlling() && triggerPair.useCandidateReceived())
if (!isControlling() && useCand)
{
logger.info("update nominated flag");
// If the Binding request received by the agent had the
@ -1370,13 +1385,6 @@ public class Agent
//ICE processing state.
checkListStatesUpdated();
}
else if(compatibilityMode != CompatibilityMode.RFC5245 &&
!isControlling())
{
//next time we will see a request it will be considered as
// having USE-CANDIDATE
triggerPair.setUseCandidateReceived();
}
return;
}