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

Skip to content
Snippets Groups Projects
Commit 691326ce authored by jrandom's avatar jrandom Committed by zzz
Browse files

make sure we kill the threads that failed to ACK, rather than leave them...

make sure we kill the threads that failed to ACK, rather than leave them sitting there, waiting forever
logging
parent 3cac1238
No related branches found
No related tags found
No related merge requests found
...@@ -352,7 +352,7 @@ public class I2PSocketManager implements I2PSessionListener { ...@@ -352,7 +352,7 @@ public class I2PSocketManager implements I2PSessionListener {
s.queueData(payload); s.queueData(payload);
return; return;
} else { } else {
_log.error("Null socket with data available"); _log.info("Null socket with data available");
throw new IllegalStateException("Null socket with data available"); throw new IllegalStateException("Null socket with data available");
} }
} }
...@@ -431,33 +431,51 @@ public class I2PSocketManager implements I2PSessionListener { ...@@ -431,33 +431,51 @@ public class I2PSocketManager implements I2PSessionListener {
throw new I2PException("Error sending through I2P network"); throw new I2PException("Error sending through I2P network");
} }
remoteID = s.getRemoteID(true, options.getConnectTimeout()); remoteID = s.getRemoteID(true, options.getConnectTimeout());
if (remoteID == null) throw new ConnectException("Connection refused by peer");
if ("".equals(remoteID)) throw new NoRouteToHostException("Unable to reach peer"); if (remoteID == null)
throw new ConnectException("Connection refused by peer");
if ("".equals(remoteID))
throw new NoRouteToHostException("Unable to reach peer");
if (_log.shouldLog(Log.DEBUG)) if (_log.shouldLog(Log.DEBUG))
_log.debug("TIMING: s given out for remoteID " + getReadableForm(remoteID)); _log.debug("TIMING: s given out for remoteID "
+ getReadableForm(remoteID));
return s; return s;
} catch (InterruptedIOException ioe) { } catch (InterruptedIOException ioe) {
_log.error("Timeout waiting for ack from syn for id " + getReadableForm(lcID), ioe); if (_log.shouldLog(Log.ERROR))
_log.error("Timeout waiting for ack from syn for id "
+ getReadableForm(lcID), ioe);
synchronized (lock) { synchronized (lock) {
_outSockets.remove(s.getLocalID()); _outSockets.remove(s.getLocalID());
} }
s.internalClose();
throw new InterruptedIOException("Timeout waiting for ack"); throw new InterruptedIOException("Timeout waiting for ack");
} catch (ConnectException ex) { } catch (ConnectException ex) {
s.internalClose();
throw ex; throw ex;
} catch (NoRouteToHostException ex) { } catch (NoRouteToHostException ex) {
s.internalClose();
throw ex; throw ex;
} catch (IOException ex) { } catch (IOException ex) {
_log.error("Error sending syn on id " + getReadableForm(lcID), ex); if (_log.shouldLog(Log.ERROR))
_log.error("Error sending syn on id " + getReadableForm(lcID), ex);
synchronized (lock) { synchronized (lock) {
_outSockets.remove(s.getLocalID()); _outSockets.remove(s.getLocalID());
} }
s.internalClose();
throw new I2PException("Unhandled IOException occurred"); throw new I2PException("Unhandled IOException occurred");
} catch (I2PException ex) { } catch (I2PException ex) {
_log.info("Error sending syn on id " + getReadableForm(lcID), ex); if (_log.shouldLog(Log.INFO))
_log.info("Error sending syn on id " + getReadableForm(lcID), ex);
synchronized (lock) { synchronized (lock) {
_outSockets.remove(s.getLocalID()); _outSockets.remove(s.getLocalID());
} }
s.internalClose();
throw ex; throw ex;
} catch (Exception e) {
s.internalClose();
_log.error("Unhandled error connecting", e);
throw new ConnectException("Unhandled error connecting: " + e.getMessage());
} }
} }
......
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