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

Skip to content
Snippets Groups Projects
Commit 1091a289 authored by zzz's avatar zzz
Browse files

* NTCP: Mark unreachable on outbound connection timeout

parent 536f5d0c
No related branches found
No related tags found
No related merge requests found
...@@ -422,15 +422,19 @@ public class EventPumper implements Runnable { ...@@ -422,15 +422,19 @@ public class EventPumper implements Runnable {
_context.statManager().addRateData("ntcp.connectSuccessful", 1, 0); _context.statManager().addRateData("ntcp.connectSuccessful", 1, 0);
} else { } else {
con.close(); con.close();
_transport.markUnreachable(con.getRemotePeer().calculateHash());
_context.statManager().addRateData("ntcp.connectFailedTimeout", 1, 0); _context.statManager().addRateData("ntcp.connectFailedTimeout", 1, 0);
} }
} catch (IOException ioe) { } catch (IOException ioe) { // this is the usual failure path for a timeout or connect refused
if (_log.shouldLog(Log.DEBUG)) _log.debug("Error processing connection", ioe); if (_log.shouldLog(Log.WARN))
_log.warn("Failed outbound connection to " + con.getRemotePeer().calculateHash(), ioe);
con.close(); con.close();
//_context.shitlist().shitlistRouter(con.getRemotePeer().calculateHash(), "Error connecting", NTCPTransport.STYLE);
_transport.markUnreachable(con.getRemotePeer().calculateHash());
_context.statManager().addRateData("ntcp.connectFailedTimeoutIOE", 1, 0); _context.statManager().addRateData("ntcp.connectFailedTimeoutIOE", 1, 0);
} catch (NoConnectionPendingException ncpe) { } catch (NoConnectionPendingException ncpe) {
// ignore // ignore
} }
} }
private void processRead(SelectionKey key) { private void processRead(SelectionKey key) {
......
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