I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit de839444 authored by jrandom's avatar jrandom Committed by zzz
Browse files

2006-04-14 jrandom

    * 0 isn't very random
    * Adjust the tunnel drop to be more reasonable
parent 90cd7ff2
No related branches found
No related tags found
No related merge requests found
......@@ -161,7 +161,11 @@ public class FortunaRandomSource extends RandomSource implements EntropyHarveste
int bytes = (numBits + 7) / 8;
for (int i = 0; i < bytes; i++)
rv += ((_fortuna.nextByte() & 0xFF) << i*8);
rv >>>= (64-numBits);
//rv >>>= (64-numBits);
if (rv < 0)
rv = 0 - rv;
int off = 8*bytes - numBits;
rv >>>= off;
return (int)rv;
}
......
$Id: history.txt,v 1.456 2006/04/14 06:42:44 jrandom Exp $
$Id: history.txt,v 1.457 2006/04/14 13:07:15 jrandom Exp $
2006-04-14 jrandom
* 0 isn't very random
* Adjust the tunnel drop to be more reasonable
2006-04-14 jrandom
* -28.00230115311259 is not between 0 and 1 in any universe I know.
......
......@@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.396 $ $Date: 2006/04/14 06:42:02 $";
public final static String ID = "$Revision: 1.397 $ $Date: 2006/04/14 13:06:40 $";
public final static String VERSION = "0.6.1.15";
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);
......
......@@ -592,7 +592,7 @@ class BuildHandler {
for (int i = 0; i < _inboundBuildMessages.size(); i++) {
BuildMessageState cur = (BuildMessageState)_inboundBuildMessages.get(i);
long age = System.currentTimeMillis() - cur.recvTime;
if (age >= BuildRequestor.REQUEST_TIMEOUT) {
if (age >= BuildRequestor.REQUEST_TIMEOUT/2) {
_inboundBuildMessages.remove(i);
i--;
dropped++;
......@@ -604,7 +604,7 @@ class BuildHandler {
_context.statManager().addRateData("tunnel.dropLoadBacklog", _inboundBuildMessages.size(), _inboundBuildMessages.size());
} else {
int queueTime = estimateQueueTime(_inboundBuildMessages.size());
float pDrop = queueTime/((float)BuildRequestor.REQUEST_TIMEOUT);
float pDrop = queueTime/((float)BuildRequestor.REQUEST_TIMEOUT/2);
pDrop = pDrop * pDrop * pDrop;
float f = _context.random().nextFloat();
if ( (pDrop > f) && (allowProactiveDrop()) ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment