diff --git a/history.txt b/history.txt index 7e7c14e3e..a78401617 100644 --- a/history.txt +++ b/history.txt @@ -1,4 +1,10 @@ -$Id: history.txt,v 1.552 2007-02-28 21:22:16 zzz Exp $ +$Id: history.txt,v 1.553 2007-02-28 21:29:12 zzz Exp $ + +2007-03-03 zzz + * Implement priority sending for NTCP + * Disable trimForOverload() in tunnel BuildExecutor which + was preventing tunnel builds when outbound traffic was high + (i.e. most of the time when running i2psnark) 2007-02-28 zzz * i2psnark: File reopen cleanup diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index bde39ea69..25181e746 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -15,9 +15,9 @@ import net.i2p.CoreVersion; * */ public class RouterVersion { - public final static String ID = "$Revision: 1.488 $ $Date: 2007-02-28 21:22:14 $"; + public final static String ID = "$Revision: 1.489 $ $Date: 2007-02-28 21:29:11 $"; public final static String VERSION = "0.6.1.27"; - public final static long BUILD = 2; + public final static long BUILD = 3; public static void main(String args[]) { System.out.println("I2P Router version: " + VERSION + "-" + BUILD); System.out.println("Router ID: " + RouterVersion.ID); diff --git a/router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java b/router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java index 1564dee23..50629ef17 100644 --- a/router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java +++ b/router/java/src/net/i2p/router/transport/ntcp/NTCPConnection.java @@ -582,12 +582,22 @@ public class NTCPConnection implements FIFOBandwidthLimiter.CompleteListener { return; } //throw new RuntimeException("We should not be preparing a write while we still have one pending"); - if (_outbound.size() > 0) { + if (queueTime() > 3*1000) { // don't stall low-priority messages msg = (OutNetMessage)_outbound.remove(0); - _currentOutbound = msg; } else { - return; + Iterator it = _outbound.iterator(); + for (int i = 0; it.hasNext() && i < 75; i++) { //arbitrary bound + OutNetMessage mmsg = (OutNetMessage) it.next(); + if (msg == null || mmsg.getPriority() > msg.getPriority()) + msg = mmsg; + } + if (msg == null) + return; + // if (_outbound.indexOf(msg) > 0) + // _log.debug("Priority message sent, pri = " + msg.getPriority() + " pos = " + _outbound.indexOf(msg) + "/" +_outbound.size()); + _outbound.remove(msg); } + _currentOutbound = msg; } msg.beginTransmission(); diff --git a/router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java b/router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java index ba64c0284..2340581f9 100644 --- a/router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java +++ b/router/java/src/net/i2p/router/tunnel/pool/BuildExecutor.java @@ -156,7 +156,8 @@ class BuildExecutor implements Runnable { // Trim the number of allowed tunnels for overload, // initiate a tunnel drop on severe overload - allowed = trimForOverload(allowed,concurrent); + // tunnel building is high priority, don't do this + // allowed = trimForOverload(allowed,concurrent); return allowed; } @@ -168,6 +169,7 @@ class BuildExecutor implements Runnable { /** * Don't even try to build tunnels if we're saturated */ +/* private int trimForOverload(int allowed, int concurrent) { // dont include the inbound rates when throttling tunnel building, since @@ -221,7 +223,7 @@ class BuildExecutor implements Runnable { // No overload, allow as requested return(allowed); } - +*/ public void run() { _isRunning = true;