forked from I2P_Developers/i2p.i2p
cleanup
This commit is contained in:
@@ -27,13 +27,13 @@ class RouterDoSThrottle extends RouterThrottleImpl {
|
||||
if (!shouldAccept) return false;
|
||||
|
||||
// now lets check for DoS
|
||||
long now = getContext().clock().now();
|
||||
long now = _context.clock().now();
|
||||
if (_currentLookupPeriod + LOOKUP_THROTTLE_PERIOD > now) {
|
||||
// same period, check for DoS
|
||||
_currentLookupCount++;
|
||||
if (_currentLookupCount >= LOOKUP_THROTTLE_MAX) {
|
||||
getContext().statManager().addRateData("router.throttleNetDbDoS", _currentLookupCount, 0);
|
||||
int rand = getContext().random().nextInt(_currentLookupCount);
|
||||
_context.statManager().addRateData("router.throttleNetDbDoS", _currentLookupCount, 0);
|
||||
int rand = _context.random().nextInt(_currentLookupCount);
|
||||
if (rand > LOOKUP_THROTTLE_MAX) {
|
||||
return false;
|
||||
} else {
|
||||
|
@@ -14,7 +14,7 @@ import net.i2p.util.SimpleTimer;
|
||||
*
|
||||
*/
|
||||
class RouterThrottleImpl implements RouterThrottle {
|
||||
private final RouterContext _context;
|
||||
protected final RouterContext _context;
|
||||
private final Log _log;
|
||||
private String _tunnelStatus;
|
||||
|
||||
@@ -538,8 +538,6 @@ class RouterThrottleImpl implements RouterThrottle {
|
||||
_tunnelStatus = msg;
|
||||
}
|
||||
|
||||
protected RouterContext getContext() { return _context; }
|
||||
|
||||
/**
|
||||
* Mark a string for extraction by xgettext and translation.
|
||||
* Use this only in static initializers.
|
||||
|
Reference in New Issue
Block a user