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

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

* NTCP: Only set keepalive if firewalled

parent 93039a68
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,7 @@ import java.util.concurrent.LinkedBlockingQueue; ...@@ -21,6 +21,7 @@ import java.util.concurrent.LinkedBlockingQueue;
import net.i2p.I2PAppContext; import net.i2p.I2PAppContext;
import net.i2p.data.RouterIdentity; import net.i2p.data.RouterIdentity;
import net.i2p.router.CommSystemFacade;
import net.i2p.router.RouterContext; import net.i2p.router.RouterContext;
import net.i2p.router.transport.FIFOBandwidthLimiter; import net.i2p.router.transport.FIFOBandwidthLimiter;
import net.i2p.util.ConcurrentHashSet; import net.i2p.util.ConcurrentHashSet;
...@@ -499,7 +500,8 @@ class EventPumper implements Runnable { ...@@ -499,7 +500,8 @@ class EventPumper implements Runnable {
return; return;
} }
// BUGFIX for firewalls. --Sponge // BUGFIX for firewalls. --Sponge
chan.socket().setKeepAlive(true); if (_context.commSystem().getReachabilityStatus() != CommSystemFacade.STATUS_OK)
chan.socket().setKeepAlive(true);
SelectionKey ckey = chan.register(_selector, SelectionKey.OP_READ); SelectionKey ckey = chan.register(_selector, SelectionKey.OP_READ);
new NTCPConnection(_context, _transport, chan, ckey); new NTCPConnection(_context, _transport, chan, ckey);
...@@ -519,7 +521,8 @@ class EventPumper implements Runnable { ...@@ -519,7 +521,8 @@ class EventPumper implements Runnable {
_log.debug("processing connect for " + con + ": connected? " + connected); _log.debug("processing connect for " + con + ": connected? " + connected);
if (connected) { if (connected) {
// BUGFIX for firewalls. --Sponge // BUGFIX for firewalls. --Sponge
chan.socket().setKeepAlive(true); if (_context.commSystem().getReachabilityStatus() != CommSystemFacade.STATUS_OK)
chan.socket().setKeepAlive(true);
con.setKey(key); con.setKey(key);
con.outboundConnected(); con.outboundConnected();
_context.statManager().addRateData("ntcp.connectSuccessful", 1); _context.statManager().addRateData("ntcp.connectSuccessful", 1);
......
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