2004-10-15 jrandom

* Replaced old minimum tunnel test timeout of 1s with a configurable
      value (router.config property "router.tunnelTestMinimum", with the
      default of 2s).
This commit is contained in:
jrandom
2004-10-15 17:39:18 +00:00
committed by zzz
parent 28c5d6c10d
commit fb1263dad7
3 changed files with 25 additions and 6 deletions

View File

@ -1,4 +1,9 @@
$Id: history.txt,v 1.47 2004/10/14 15:02:45 jrandom Exp $
$Id: history.txt,v 1.48 2004/10/14 20:20:12 jrandom Exp $
2004-10-15 jrandom
* Replaced old minimum tunnel test timeout of 1s with a configurable
value (router.config property "router.tunnelTestMinimum", with the
default of 2s).
2004-10-14 jrandom
* Tunnel rejection is no longer a sign of an overwhelmingly loaded

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.54 $ $Date: 2004/10/14 15:02:45 $";
public final static String ID = "$Revision: 1.55 $ $Date: 2004/10/14 20:20:12 $";
public final static String VERSION = "0.4.1.2";
public final static long BUILD = 4;
public final static long BUILD = 5;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION);
System.out.println("Router ID: " + RouterVersion.ID);

View File

@ -74,7 +74,7 @@ class TestTunnelJob extends JobImpl {
}
private final static long DEFAULT_TEST_TIMEOUT = 10*1000; // 10 seconds for a test to succeed
private final static long MINIMUM_TEST_TIMEOUT = 1*1000; // 1 second min
private final static long DEFAULT_MINIMUM_TEST_TIMEOUT = 2*1000; // 2 second min
private final static int TEST_PRIORITY = 100;
/**
@ -94,8 +94,9 @@ class TestTunnelJob extends JobImpl {
}
}
}
if (rv < MINIMUM_TEST_TIMEOUT)
rv = MINIMUM_TEST_TIMEOUT;
long min = getMinimumTestTimeout();
if (rv < min)
rv = min;
return rv;
}
@ -110,6 +111,19 @@ class TestTunnelJob extends JobImpl {
}
}
private long getMinimumTestTimeout() {
String timeout = getContext().getProperty("router.tunnelTestMinimum", ""+DEFAULT_MINIMUM_TEST_TIMEOUT);
if (timeout != null) {
try {
return Long.parseLong(timeout);
} catch (NumberFormatException nfe) {
return DEFAULT_MINIMUM_TEST_TIMEOUT;
}
} else {
return DEFAULT_MINIMUM_TEST_TIMEOUT;
}
}
/**
* Send a message out the tunnel with instructions to send the message back
* to ourselves and wait for it to arrive.