* Streaming: Randomize end of first conn limit period

to prevent correlation
This commit is contained in:
zzz
2013-10-26 20:45:30 +00:00
parent 2814fe75b1
commit ddf761b1f8

View File

@ -4,6 +4,7 @@ import java.util.concurrent.atomic.AtomicInteger;
import net.i2p.data.Hash;
import net.i2p.util.ObjectCounter;
import net.i2p.util.RandomSource;
import net.i2p.util.SimpleScheduler;
import net.i2p.util.SimpleTimer;
@ -29,7 +30,12 @@ class ConnThrottler {
_totalMax = totalMax;
this.counter = new ObjectCounter<Hash>();
_currentTotal = new AtomicInteger();
SimpleScheduler.getInstance().addPeriodicEvent(new Cleaner(), period);
// shorten the initial period by a random amount,mpleScheduler.getInstance().addPeriodicEvent(new Cleaner(),
// to prevent correlation across destinations
// and identification of router startup time
SimpleScheduler.getInstance().addPeriodicEvent(new Cleaner(),
RandomSource.getInstance().nextLong(period),
period);
}
/*