From fab4966215c3d7d0d5798d3855ab96315232a5f9 Mon Sep 17 00:00:00 2001 From: seb Date: Mon, 10 Oct 2011 12:57:51 +0000 Subject: [PATCH] CandidatePair can be updated with useCandidateReceived even if the state is not succeeded. --- src/org/ice4j/ice/Agent.java | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/org/ice4j/ice/Agent.java b/src/org/ice4j/ice/Agent.java index 439814c..3ab4ad6 100644 --- a/src/org/ice4j/ice/Agent.java +++ b/src/org/ice4j/ice/Agent.java @@ -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; }