I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 2f5f91a0 authored by zzz's avatar zzz
Browse files

log tweaks

parent 485acd6c
No related branches found
No related tags found
No related merge requests found
...@@ -420,31 +420,33 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna ...@@ -420,31 +420,33 @@ public abstract class I2PTunnelClientBase extends I2PTunnelTask implements Runna
* @since 0.9.20 * @since 0.9.20
*/ */
private void connectManager() { private void connectManager() {
// shadows instance _log
Log _log = getTunnel().getContext().logManager().getLog(I2PTunnelClientBase.class);
Logging log = this.l;
int retries = 0; int retries = 0;
while (sockMgr.getSession().isClosed()) { while (sockMgr.getSession().isClosed()) {
try { try {
sockMgr.getSession().connect(); sockMgr.getSession().connect();
} catch (I2PSessionException ise) { } catch (I2PSessionException ise) {
// shadows instance _log
Log _log = getTunnel().getContext().logManager().getLog(I2PTunnelClientBase.class);
Logging log = this.l;
// try to make this error sensible as it will happen... // try to make this error sensible as it will happen...
String portNum = getTunnel().port; String portNum = getTunnel().port;
if (portNum == null) if (portNum == null)
portNum = "7654"; portNum = "7654";
String msg = "Unable to connect to the router at " + getTunnel().host + ':' + portNum + String msg;
if (getTunnel().getContext().isRouterContext())
msg = "Unable to connect to the router at " + getTunnel().host + ':' + portNum +
" and build tunnels for the client"; " and build tunnels for the client";
else
msg = "Unable to build tunnels for the client";
if (++retries < MAX_RETRIES) { if (++retries < MAX_RETRIES) {
if (log != null) if (log != null)
log.log(msg + ", retrying in " + (RETRY_DELAY / 1000) + " seconds"); log.log(msg + ", retrying in " + (RETRY_DELAY / 1000) + " seconds");
_log.error(msg + ", retrying in " + (RETRY_DELAY / 1000) + " seconds"); _log.error(msg + ", retrying in " + (RETRY_DELAY / 1000) + " seconds", ise);
} else { } else {
if (log != null) if (log != null)
log.log(msg + ", giving up"); log.log(msg + ", giving up");
_log.log(Log.CRIT, msg + ", giving up"); _log.log(Log.CRIT, msg + ", giving up", ise);
// not clear if callers can handle null throw new IllegalArgumentException(msg, ise);
//return null;
throw new IllegalArgumentException(msg);
} }
try { Thread.sleep(RETRY_DELAY); } catch (InterruptedException ie) {} try { Thread.sleep(RETRY_DELAY); } catch (InterruptedException ie) {}
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment