2006-05-07 Complication
* Fix problem whereby repeated calls to allowed() would make the 1-tunnel exception permit more than one concurrent build
This commit is contained in:
@ -1,4 +1,8 @@
|
||||
$Id: history.txt,v 1.469 2006/05/04 18:09:17 jrandom Exp $
|
||||
$Id: history.txt,v 1.470 2006/05/06 15:27:35 jrandom Exp $
|
||||
|
||||
2006-05-07 Complication
|
||||
* Fix problem whereby repeated calls to allowed() would make
|
||||
the 1-tunnel exception permit more than one concurrent build
|
||||
|
||||
2006-05-06 jrandom
|
||||
* Readjust the tunnel creation timeouts to reject less but fail earlier,
|
||||
|
@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
|
||||
*
|
||||
*/
|
||||
public class RouterVersion {
|
||||
public final static String ID = "$Revision: 1.409 $ $Date: 2006/05/04 18:08:51 $";
|
||||
public final static String ID = "$Revision: 1.410 $ $Date: 2006/05/06 15:27:35 $";
|
||||
public final static String VERSION = "0.6.1.17";
|
||||
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 + "-" + BUILD);
|
||||
System.out.println("Router ID: " + RouterVersion.ID);
|
||||
|
@ -122,10 +122,16 @@ class BuildExecutor implements Runnable {
|
||||
int used1s = _context.router().get1sRate(true);
|
||||
// If 1-second average indicates we could manage building one tunnel
|
||||
if ((maxKBps*1024) - used1s > BUILD_BANDWIDTH_ESTIMATE_BYTES) {
|
||||
// Allow one
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("We had overload, but 1s bandwidth was " + used1s + " so allowed building 1.");
|
||||
return 1;
|
||||
// Check if we're already building some tunnels
|
||||
if (concurrent > 0) {
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("Mild overload and favourable 1s rate (" + used1s + ") but already building, so allowed 0.");
|
||||
return 0;
|
||||
} else {
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("Mild overload and favourable 1s rate(" + used1s + "), so allowed 1.");
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
// Allow none
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
|
Reference in New Issue
Block a user