From 988de3fbfff78f9bbb1de424feaa696b09efe0dc Mon Sep 17 00:00:00 2001 From: emcho Date: Sat, 8 May 2010 21:36:58 +0000 Subject: [PATCH] Implements client side support for Updating Pair States (RFC 5245: Section 7.1.3.2.3). So did the previous commit despite the wrong commit message --- src/org/ice4j/ice/Agent.java | 1 - .../ice/checks/ConnectivityCheckClient.java | 25 +++++++++++-------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/org/ice4j/ice/Agent.java b/src/org/ice4j/ice/Agent.java index d8906c2..4f95406 100644 --- a/src/org/ice4j/ice/Agent.java +++ b/src/org/ice4j/ice/Agent.java @@ -643,7 +643,6 @@ public class Agent if (list != null) list.recomputePairPriorities(); } - } /** diff --git a/src/org/ice4j/ice/checks/ConnectivityCheckClient.java b/src/org/ice4j/ice/checks/ConnectivityCheckClient.java index 8429b90..e948615 100644 --- a/src/org/ice4j/ice/checks/ConnectivityCheckClient.java +++ b/src/org/ice4j/ice/checks/ConnectivityCheckClient.java @@ -332,17 +332,16 @@ public class ConnectivityCheckClient boolean wasFrozen = checkList.isFrozen(); for(CandidatePair pair : checkList) - if (parentStream.containsFoundation(pair.getFoundation())) + if (parentStream.containsFoundation(pair.getFoundation()) + && pair.getState() == CandidatePairState.FROZEN) pair.setStateWaiting(); - //if the checklList is still frozen after the above operations, and - //there are no pairs in the check list whose foundation matches a - //pair in the valid list under consideration, the agent groups - //together all of the pairs with the same foundation, and for each - //group, sets the state of the pair with the lowest component ID to - //Waiting. If there is more than one such pair, the one with the - //highest priority is used. - if(!checkList.isFrozen()) + //if the checklList is still frozen after the above operations, + //the agent groups together all of the pairs with the same + //foundation, and for each group, sets the state of the pair with + //the lowest component ID to Waiting. If there is more than one + //such pair, the one with the highest priority is used. + if(checkList.isFrozen()) checkList.computeInitialCheckListPairStates(); if (wasFrozen) @@ -375,8 +374,12 @@ public class ConnectivityCheckClient CandidatePair pair = ((CandidatePair)evt.getTransactionID() .getApplicationData()); - return pair.getLocalCandidate().equals(evt.getLocalAddress()) - && pair.getRemoteCandidate().equals(evt.getRemoteAddress()); + boolean sym = pair.getLocalCandidate().getTransportAddress() + .equals(evt.getLocalAddress()) + && pair.getRemoteCandidate().getTransportAddress() + .equals(evt.getRemoteAddress()); + + return sym; } /**