From cd826a123356ebb237ced29e994aa169b91c415a Mon Sep 17 00:00:00 2001 From: boris Date: Fri, 13 Mar 2015 13:38:38 +0000 Subject: [PATCH] Treat the TERMINATED state the same as COMPLETED when handling binding responses. --- src/org/ice4j/ice/Agent.java | 2 +- src/org/ice4j/ice/ConnectivityCheckClient.java | 3 +-- src/org/ice4j/ice/IceProcessingState.java | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/org/ice4j/ice/Agent.java b/src/org/ice4j/ice/Agent.java index 76ec174..1000005 100644 --- a/src/org/ice4j/ice/Agent.java +++ b/src/org/ice4j/ice/Agent.java @@ -1696,7 +1696,7 @@ public class Agent boolean allListsEnded = true; boolean atLeastOneListSucceeded = false; - if(getState() == IceProcessingState.COMPLETED) + if(getState().isEstablished()) return; List streams = getStreams(); diff --git a/src/org/ice4j/ice/ConnectivityCheckClient.java b/src/org/ice4j/ice/ConnectivityCheckClient.java index 26aa466..957900b 100644 --- a/src/org/ice4j/ice/ConnectivityCheckClient.java +++ b/src/org/ice4j/ice/ConnectivityCheckClient.java @@ -373,8 +373,7 @@ class ConnectivityCheckClient = checkedPair.getParentComponent().getParentStream(); final CheckList checkList = stream.getCheckList(); - if(stream.getParentAgent().getState().equals( - IceProcessingState.COMPLETED)) + if(stream.getParentAgent().getState().isEstablished()) return; //If all of the pairs in the check list are now either in the Failed or diff --git a/src/org/ice4j/ice/IceProcessingState.java b/src/org/ice4j/ice/IceProcessingState.java index c329d75..d0f5c51 100644 --- a/src/org/ice4j/ice/IceProcessingState.java +++ b/src/org/ice4j/ice/IceProcessingState.java @@ -87,4 +87,18 @@ public enum IceProcessingState { return stateName; } + + /** + * Returns true iff the state is one in which a connection + * has been established, that is either COMPLETED or + * TERMINATED. + * + * @return true iff the state is one in which a connection + * has been established, that is either COMPLETED or + * TERMINATED. + */ + public boolean isEstablished() + { + return this == COMPLETED || this == TERMINATED; + } }