forked from I2P_Developers/i2p.i2p
Compare commits
7 Commits
i2p.i2p.2.
...
i2p.i2p.2.
Author | SHA1 | Date | |
---|---|---|---|
9c6d444f3f | |||
6ba84f7076 | |||
fbb53802c7 | |||
6df76bb42c | |||
6bf2cc856d | |||
8ae54270c9 | |||
fdb6701bf5 |
@ -83,8 +83,7 @@ public class FloodfillDatabaseLookupMessageHandler implements HandlerJobBuilder
|
||||
_context.statManager().addRateData("netDb.nonFFLookupsDropped", 1);
|
||||
return null;
|
||||
}
|
||||
if ((!_facade.shouldThrottleLookup(dlm.getFrom(), dlm.getReplyTunnel())
|
||||
&& !_facade.shouldThrottleBurstLookup(dlm.getFrom(), dlm.getReplyTunnel()))
|
||||
if (!_facade.shouldThrottleLookup(dlm.getFrom(), dlm.getReplyTunnel())
|
||||
|| _context.routerHash().equals(dlm.getFrom())) {
|
||||
Job j = new HandleFloodfillDatabaseLookupMessageJob(_context, dlm, from, fromHash, _msgIDBloomXor);
|
||||
// if (false) {
|
||||
|
@ -41,10 +41,7 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
|
||||
private final Set<Hash> _verifiesInProgress;
|
||||
private FloodThrottler _floodThrottler;
|
||||
private LookupThrottler _lookupThrottler;
|
||||
private LookupThrottler _lookupThrottlerBurst;
|
||||
private final Job _ffMonitor;
|
||||
private final int DROP_LOOKUP_BURST = 10;
|
||||
private final int DROP_LOOKUP_BURST_INTERVAL = 30*1000;
|
||||
|
||||
/**
|
||||
* This is the flood redundancy. Entries are
|
||||
@ -112,7 +109,6 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
|
||||
} else {
|
||||
isFF = _context.getBooleanProperty(FloodfillMonitorJob.PROP_FLOODFILL_PARTICIPANT);
|
||||
_lookupThrottler = new LookupThrottler();
|
||||
_lookupThrottlerBurst = new LookupThrottler(DROP_LOOKUP_BURST, DROP_LOOKUP_BURST_INTERVAL);
|
||||
}
|
||||
|
||||
long down = _context.router().getEstimatedDowntime();
|
||||
@ -240,11 +236,6 @@ public class FloodfillNetworkDatabaseFacade extends KademliaNetworkDatabaseFacad
|
||||
return _lookupThrottler == null || _lookupThrottler.shouldThrottle(from, id);
|
||||
}
|
||||
|
||||
boolean shouldThrottleBurstLookup(Hash from, TunnelId id) {
|
||||
// null before startup
|
||||
return _lookupThrottlerBurst == null || _lookupThrottlerBurst.shouldThrottle(from, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* If we are floodfill AND the key is not throttled,
|
||||
* flood it, otherwise don't.
|
||||
|
@ -23,8 +23,8 @@ class LookupThrottler {
|
||||
private final int MAX_LOOKUPS; // DEFAULT=20
|
||||
private final long CLEAN_TIME; // DEFAULT=3*60*1000
|
||||
LookupThrottler() {
|
||||
MAX_LOOKUPS = 20;
|
||||
CLEAN_TIME = 3*60*1000;
|
||||
MAX_LOOKUPS = 14;
|
||||
CLEAN_TIME = 2*60*1000;
|
||||
this.counter = new ObjectCounter<ReplyTunnel>();
|
||||
SimpleTimer2.getInstance().addPeriodicEvent(new Cleaner(), CLEAN_TIME);
|
||||
}
|
||||
|
Reference in New Issue
Block a user