From 47c73815a957dd25f3506244459d616a57a0e23e Mon Sep 17 00:00:00 2001 From: seb Date: Thu, 1 Sep 2011 14:37:09 +0000 Subject: [PATCH] Fixes a recursion problem in Candidate.equals which happen by comparing two RelayedCandidates with same address/port. --- src/org/ice4j/ice/Candidate.java | 3 ++- src/org/ice4j/ice/ConnectivityCheckClient.java | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/org/ice4j/ice/Candidate.java b/src/org/ice4j/ice/Candidate.java index 2efb645..aae9c4a 100644 --- a/src/org/ice4j/ice/Candidate.java +++ b/src/org/ice4j/ice/Candidate.java @@ -285,7 +285,8 @@ public abstract class Candidate } //compare other properties - if(getBase().equals(targetCandidate.getBase()) + if(((getBase() == this && targetCandidate.getBase() == targetCandidate) + || getBase().equals(targetCandidate.getBase())) && getPriority() == targetCandidate.getPriority() && getType() == targetCandidate.getType() && getFoundation().equals(targetCandidate.getFoundation())) diff --git a/src/org/ice4j/ice/ConnectivityCheckClient.java b/src/org/ice4j/ice/ConnectivityCheckClient.java index 05c5fbe..3ec3635 100644 --- a/src/org/ice4j/ice/ConnectivityCheckClient.java +++ b/src/org/ice4j/ice/ConnectivityCheckClient.java @@ -297,6 +297,10 @@ class ConnectivityCheckClient = checkedPair.getParentComponent().getParentStream(); final CheckList checkList = stream.getCheckList(); + if(stream.getParentAgent().getState().equals( + IceProcessingState.COMPLETED)) + return; + //If all of the pairs in the check list are now either in the Failed or //Succeeded state: boolean allPairsDone = true;