2004-11-19 jrandom

* Off-by-one fix to the tunnel pool management code, along side some
      explicit initialization.  This can affect clients whose lengths are
      shorter than the router's default (thanks duck!)
This commit is contained in:
jrandom
2004-11-19 23:04:27 +00:00
committed by zzz
parent c8f6d9c7a1
commit 0b48b18e7e
4 changed files with 28 additions and 21 deletions

View File

@ -1,4 +1,9 @@
$Id: history.txt,v 1.74 2004/11/17 13:34:25 jrandom Exp $
$Id: history.txt,v 1.75 2004/11/17 14:42:53 jrandom Exp $
2004-11-19 jrandom
* Off-by-one fix to the tunnel pool management code, along side some
explicit initialization. This can affect clients whose lengths are
shorter than the router's default (thanks duck!)
2004-11-17 jrandom
* Fix to propogate i2psocket options into the SAM bridge correctly (thanks

View File

@ -68,20 +68,20 @@ public class ClientTunnelSettings {
public final static boolean DEFAULT_STRICT_MINIMUM_LENGTH = true;
public ClientTunnelSettings() {
_numInbound = 0;
_numOutbound = 0;
_depthInbound = 0;
_depthOutbound = 0;
_msgsPerMinuteAvgInbound = 0;
_bytesPerMinuteAvgInbound = 0;
_msgsPerMinutePeakInbound = 0;
_bytesPerMinutePeakInbound = 0;
_includeDummyInbound = false;
_includeDummyOutbound = false;
_reorderInbound = false;
_reorderOutbound = false;
_inboundDuration = -1;
_enforceStrictMinimumLength = false;
_numInbound = DEFAULT_NUM_INBOUND;
_numOutbound = DEFAULT_NUM_OUTBOUND;
_depthInbound = DEFAULT_DEPTH_INBOUND;
_depthOutbound = DEFAULT_DEPTH_OUTBOUND;
_msgsPerMinuteAvgInbound = DEFAULT_MSGS_AVG;
_bytesPerMinuteAvgInbound = DEFAULT_BYTES_AVG;
_msgsPerMinutePeakInbound = DEFAULT_MSGS_PEAK;
_bytesPerMinutePeakInbound = DEFAULT_BYTES_PEAK;
_includeDummyInbound = DEFAULT_DUMMY_INBOUND;
_includeDummyOutbound = DEFAULT_DUMMY_OUTBOUND;
_reorderInbound = DEFAULT_REORDER_INBOUND;
_reorderOutbound = DEFAULT_REORDER_OUTBOUND;
_inboundDuration = DEFAULT_DURATION;
_enforceStrictMinimumLength = DEFAULT_STRICT_MINIMUM_LENGTH;
}
public int getNumInboundTunnels() { return _numInbound; }

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.79 $ $Date: 2004/11/17 13:34:26 $";
public final static String ID = "$Revision: 1.80 $ $Date: 2004/11/17 14:42:53 $";
public final static String VERSION = "0.4.1.4";
public final static long BUILD = 8;
public final static long BUILD = 9;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION);
System.out.println("Router ID: " + RouterVersion.ID);

View File

@ -186,12 +186,12 @@ class ClientTunnelPoolManagerJob extends JobImpl {
return false;
}
int length = info.getLength();
int length = info.getLength() - 1; // -1 because .getLength() includes us
if (_clientPool.getClientSettings().getEnforceStrictMinimumLength()) {
if (length < _clientPool.getClientSettings().getDepthInbound()) {
// we will require at least the client's length, but they dont meet it
if (_log.shouldLog(Log.DEBUG))
_log.debug("Refusing tunnel " + info.getTunnelId()
_log.debug("Strictly refusing tunnel " + info.getTunnelId()
+ " because it is too short (length = " + length
+ ", wanted = " + _clientPool.getClientSettings().getDepthInbound()
+ ")");
@ -205,7 +205,7 @@ class ClientTunnelPoolManagerJob extends JobImpl {
// the best we have on hand (which may be less that their requested length)
// this tunnel however meets neither criteria
if (_log.shouldLog(Log.DEBUG))
_log.debug("Refusing tunnel " + info.getTunnelId()
_log.debug("Loosely refusing tunnel " + info.getTunnelId()
+ " because it is too short (length = " + length
+ ", wanted = " + _clientPool.getClientSettings().getDepthInbound()
+ ")");
@ -230,7 +230,9 @@ class ClientTunnelPoolManagerJob extends JobImpl {
}
if (_log.shouldLog(Log.DEBUG))
_log.debug("Accepting tunnel " + info.getTunnelId());
_log.debug("Accepting tunnel for length=" + _clientPool.getClientSettings().getDepthInbound() +
" and dest=" + _clientPool.getDestination().calculateHash().toBase64().substring(0,6)
+ " for " + info.getTunnelId());
return true;
}