mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-10-23 00:02:59 +00:00
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:
1 parent
28c5d6c10d
commit
fb1263dad7
3 files changed
+25
-6
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user