NTCP: Add nodelay option for testing

This commit is contained in:
zzz
2020-11-24 14:48:59 +00:00
parent 4b445e7d35
commit d8924119b5
3 changed files with 25 additions and 1 deletions

View File

@@ -1,3 +1,20 @@
2020-11-24 zzz
* Build: Fix targets for git
* NTCP: Add nodelay option for testing
2020-11-23 zzz
* Console: Serve default favicon.ico
* i2pcontrol: Basic HTML fixes and HTTP headers for static pages
2020-11-22 zzz
* NetDB: Increase min FF version for LS lookups
2020-11-21 zzz
* i2psnark: Remove old default opentrackers
* Proxy:
- Remove old default jump servers
- Fix CSP for conflict error page
2020-11-20 zzz
* NetDB: Increase exploration rate when hidden
* Tomcat 9.0.40

View File

@@ -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 = 16;
public final static long BUILD = 17;
/** for example "-test" */
public final static String EXTRA = "-rc";

View File

@@ -57,6 +57,7 @@ class EventPumper implements Runnable {
private final ObjectCounter<ByteArray> _blockedIPs;
private long _expireIdleWriteTime;
private static final boolean _useDirect = false;
private final boolean _nodelay;
/**
* This probably doesn't need to be bigger than the largest typical
@@ -102,6 +103,7 @@ class EventPumper implements Runnable {
* @see java.nio.ByteBuffer
*/
//private static final String PROP_DIRECT = "i2np.ntcp.useDirectBuffers";
private static final String PROP_NODELAY = "i2np.ntcp.nodelay";
private static final int MIN_MINB = 4;
private static final int MAX_MINB = 12;
@@ -128,6 +130,7 @@ class EventPumper implements Runnable {
_context.statManager().createRateStat("ntcp.zeroRead", "", "ntcp", new long[] {10*60*1000} );
_context.statManager().createRateStat("ntcp.zeroReadDrop", "", "ntcp", new long[] {10*60*1000} );
_context.statManager().createRateStat("ntcp.dropInboundNoMessage", "", "ntcp", new long[] {10*60*1000} );
_nodelay = ctx.getBooleanProperty(PROP_NODELAY);
}
public synchronized void startPumping() {
@@ -531,6 +534,8 @@ class EventPumper implements Runnable {
if (shouldSetKeepAlive(chan))
chan.socket().setKeepAlive(true);
if (_nodelay)
chan.socket().setTcpNoDelay(true);
SelectionKey ckey = chan.register(_selector, SelectionKey.OP_READ);
NTCPConnection con = new NTCPConnection(_context, _transport, chan, ckey);
@@ -551,6 +556,8 @@ class EventPumper implements Runnable {
if (connected) {
if (shouldSetKeepAlive(chan))
chan.socket().setKeepAlive(true);
if (_nodelay)
chan.socket().setTcpNoDelay(true);
// key was already set when the channel was created, why do it again here?
con.setKey(key);
con.outboundConnected();