forked from I2P_Developers/i2p.i2p
* Firewall fix for NTCP, where firewalls will forget a NAT relationship
on a stream... AKA setting keepalive. This should fix the stuck NTCP issue that has been bothing zzz for years. * Set keepalive on BOB connections too, since this will assist closing the connections in the event of a crash on a client.
This commit is contained in:
@@ -18,7 +18,7 @@ public class RouterVersion {
|
||||
/** deprecated */
|
||||
public final static String ID = "Monotone";
|
||||
public final static String VERSION = CoreVersion.VERSION;
|
||||
public final static long BUILD = 4;
|
||||
public final static long BUILD = 5;
|
||||
|
||||
/** for example "-test" */
|
||||
public final static String EXTRA = "-rc";
|
||||
|
@@ -418,6 +418,8 @@ public class EventPumper implements Runnable {
|
||||
try { chan.close(); } catch (IOException ioe) { }
|
||||
return;
|
||||
}
|
||||
// BUGFIX for firewalls. --Sponge
|
||||
chan.socket().setKeepAlive(true);
|
||||
|
||||
SelectionKey ckey = chan.register(_selector, SelectionKey.OP_READ);
|
||||
NTCPConnection con = new NTCPConnection(_context, _transport, chan, ckey);
|
||||
@@ -436,6 +438,8 @@ public class EventPumper implements Runnable {
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("processing connect for " + key + " / " + con + ": connected? " + connected);
|
||||
if (connected) {
|
||||
// BUGFIX for firewalls. --Sponge
|
||||
chan.socket().setKeepAlive(true);
|
||||
con.setKey(key);
|
||||
con.outboundConnected();
|
||||
_context.statManager().addRateData("ntcp.connectSuccessful", 1, 0);
|
||||
|
Reference in New Issue
Block a user