From d9245d9cc540a1227311d451af965e2305f67989 Mon Sep 17 00:00:00 2001 From: Volker Berlin Date: Mon, 3 Jun 2024 13:57:14 +0200 Subject: [PATCH 1/2] Agent should failed on SocketNotFoundException #280 If there are no matching candidate because a configuration mistake then the agent should failed. --- src/main/java/org/ice4j/ice/ConnectivityCheckClient.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/ice4j/ice/ConnectivityCheckClient.java b/src/main/java/org/ice4j/ice/ConnectivityCheckClient.java index 983a72ba..525585b2 100644 --- a/src/main/java/org/ice4j/ice/ConnectivityCheckClient.java +++ b/src/main/java/org/ice4j/ice/ConnectivityCheckClient.java @@ -344,6 +344,8 @@ protected TransactionID startCheckForPair( { logger.trace("checking pair " + candidatePair + " tid " + tran); } + + return tran; } catch (NetAccessManager.SocketNotFoundException e) { @@ -351,8 +353,6 @@ protected TransactionID startCheckForPair( } catch (Exception ex) { - tran = null; - IceSocketWrapper stunSocket = localCandidate.getStunSocket(null); if (stunSocket != null) @@ -376,7 +376,7 @@ protected TransactionID startCheckForPair( } } - return tran; + return null; } /** @@ -944,6 +944,7 @@ protected void run() "Pair failed: " + pairToCheck.toShortString()); pairToCheck.setStateFailed(); + updateCheckListAndTimerStates(pairToCheck); } else { From a2764c8c74435c33403f83444eaeda6506d99fa9 Mon Sep 17 00:00:00 2001 From: Volker Berlin Date: Wed, 2 Oct 2024 10:52:40 +0200 Subject: [PATCH 2/2] call updateCheckListAndTimerStates() outside of synchronized --- src/main/java/org/ice4j/ice/ConnectivityCheckClient.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/ice4j/ice/ConnectivityCheckClient.java b/src/main/java/org/ice4j/ice/ConnectivityCheckClient.java index 525585b2..df721b3f 100644 --- a/src/main/java/org/ice4j/ice/ConnectivityCheckClient.java +++ b/src/main/java/org/ice4j/ice/ConnectivityCheckClient.java @@ -944,13 +944,16 @@ protected void run() "Pair failed: " + pairToCheck.toShortString()); pairToCheck.setStateFailed(); - updateCheckListAndTimerStates(pairToCheck); } else { pairToCheck.setStateInProgress(transactionID); } } + if (pairToCheck.getState() == CandidatePairState.FAILED) + { + updateCheckListAndTimerStates(pairToCheck); + } } else {