Logs only some debug information in certain state and don't log stacktrace for 'no route to host' exception.

This commit is contained in:
seb 2011-10-24 13:44:07 +00:00
parent cae2e2ec9c
commit 63915fab36

View File

@ -6,6 +6,7 @@
*/ */
package org.ice4j.ice; package org.ice4j.ice;
import java.net.*;
import java.util.*; import java.util.*;
import java.util.logging.*; import java.util.logging.*;
@ -284,11 +285,21 @@ class ConnectivityCheckClient
{ {
IceSocketWrapper stunSocket = localCandidate.getStunSocket(null); IceSocketWrapper stunSocket = localCandidate.getStunSocket(null);
if(stunSocket != null) if(stunSocket != null)
logger.log( {
Level.INFO, String msg = "Failed to send " + request
"Failed to send " + request + " through " + stunSocket.getLocalSocketAddress();
+ " through " + stunSocket.getLocalSocketAddress(),
ex); if((ex instanceof NoRouteToHostException) ||
(ex.getMessage() != null &&
ex.getMessage().equals("No route to host")))
{
msg += " No route to host";
ex = null;
}
logger.log(Level.INFO, msg, ex);
}
stunSocket = null; stunSocket = null;
tran = null; tran = null;
} }
@ -678,10 +689,13 @@ class ConnectivityCheckClient
} }
} }
logger.info("IsControlling: " + parentAgent.isControlling() + if(validPair.getParentComponent().getSelectedPair() == null)
" USE-CANDIDATE:" + {
(request.containsAttribute(Attribute.USE_CANDIDATE) || logger.info("IsControlling: " + parentAgent.isControlling() +
checkedPair.useCandidateSent())); " USE-CANDIDATE:" +
(request.containsAttribute(Attribute.USE_CANDIDATE) ||
checkedPair.useCandidateSent()));
}
//If the agent was a controlling agent, and it had included a USE- //If the agent was a controlling agent, and it had included a USE-
//CANDIDATE attribute in the Binding request, the valid pair generated //CANDIDATE attribute in the Binding request, the valid pair generated