forked from I2P_Developers/i2p.i2p
* Blocklist: Include IP in shitlist reason
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2011-09-08 zzz
|
||||||
|
* Blocklist: Include IP in shitlist reason
|
||||||
|
* Ministreaming: Drop old classes replaced by streaming
|
||||||
|
years ago.
|
||||||
|
* NTCP: Hopefully fix race NPE, thx devzero
|
||||||
|
* Tunnels: Limit Bloom filter size based on max memory
|
||||||
|
|
||||||
2011-09-07 zzz
|
2011-09-07 zzz
|
||||||
* Console: Limit max displayed participating tunnels
|
* Console: Limit max displayed participating tunnels
|
||||||
* JobQueue: Change queue from a Set to a TreeSet for more efficiency
|
* JobQueue: Change queue from a Set to a TreeSet for more efficiency
|
||||||
@@ -6,7 +13,7 @@
|
|||||||
time List for space savings.
|
time List for space savings.
|
||||||
|
|
||||||
2011-09-06 zzz
|
2011-09-06 zzz
|
||||||
* Console: Move configservice.jsp rendering code from
|
* Console: Move jobs.jsp rendering code from
|
||||||
the router to the console
|
the router to the console
|
||||||
* Crypto: Rework use of SHA256 for efficiency and
|
* Crypto: Rework use of SHA256 for efficiency and
|
||||||
to avoid clogging the Hash cache with one-time hashes,
|
to avoid clogging the Hash cache with one-time hashes,
|
||||||
|
@@ -18,7 +18,7 @@ public class RouterVersion {
|
|||||||
/** deprecated */
|
/** deprecated */
|
||||||
public final static String ID = "Monotone";
|
public final static String ID = "Monotone";
|
||||||
public final static String VERSION = CoreVersion.VERSION;
|
public final static String VERSION = CoreVersion.VERSION;
|
||||||
public final static long BUILD = 13;
|
public final static long BUILD = 14;
|
||||||
|
|
||||||
/** for example "-test" */
|
/** for example "-test" */
|
||||||
public final static String EXTRA = "";
|
public final static String EXTRA = "";
|
||||||
|
@@ -13,9 +13,9 @@ import net.i2p.util.DecayingHashSet;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class BloomFilterIVValidator implements IVValidator {
|
public class BloomFilterIVValidator implements IVValidator {
|
||||||
private RouterContext _context;
|
private final RouterContext _context;
|
||||||
private DecayingBloomFilter _filter;
|
private final DecayingBloomFilter _filter;
|
||||||
private ByteCache _ivXorCache = ByteCache.getInstance(32, HopProcessor.IV_LENGTH);
|
private final ByteCache _ivXorCache = ByteCache.getInstance(32, HopProcessor.IV_LENGTH);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* After 2*halflife, an entry is completely forgotten from the bloom filter.
|
* After 2*halflife, an entry is completely forgotten from the bloom filter.
|
||||||
@@ -27,18 +27,24 @@ public class BloomFilterIVValidator implements IVValidator {
|
|||||||
private static final int MIN_SHARE_KBPS_TO_USE_BLOOM = 64;
|
private static final int MIN_SHARE_KBPS_TO_USE_BLOOM = 64;
|
||||||
private static final int MIN_SHARE_KBPS_FOR_BIG_BLOOM = 512;
|
private static final int MIN_SHARE_KBPS_FOR_BIG_BLOOM = 512;
|
||||||
private static final int MIN_SHARE_KBPS_FOR_HUGE_BLOOM = 1536;
|
private static final int MIN_SHARE_KBPS_FOR_HUGE_BLOOM = 1536;
|
||||||
|
private static final long MIN_MEM_TO_USE_BLOOM = 64*1024*1024l;
|
||||||
|
private static final long MIN_MEM_FOR_BIG_BLOOM = 128*1024*1024l;
|
||||||
|
private static final long MIN_MEM_FOR_HUGE_BLOOM = 256*1024*1024l;
|
||||||
|
|
||||||
public BloomFilterIVValidator(RouterContext ctx, int KBps) {
|
public BloomFilterIVValidator(RouterContext ctx, int KBps) {
|
||||||
_context = ctx;
|
_context = ctx;
|
||||||
// Select the filter based on share bandwidth.
|
// Select the filter based on share bandwidth and memory.
|
||||||
// Note that at rates above 512KB, we increase the filter size
|
// Note that at rates above 512KB, we increase the filter size
|
||||||
// to keep acceptable false positive rates.
|
// to keep acceptable false positive rates.
|
||||||
// See DBF, BloomSHA1, and KeySelector for details.
|
// See DBF, BloomSHA1, and KeySelector for details.
|
||||||
if (KBps < MIN_SHARE_KBPS_TO_USE_BLOOM)
|
long maxMemory = Runtime.getRuntime().maxMemory();
|
||||||
|
if (maxMemory == Long.MAX_VALUE)
|
||||||
|
maxMemory = 96*1024*1024l;
|
||||||
|
if (KBps < MIN_SHARE_KBPS_TO_USE_BLOOM || maxMemory < MIN_MEM_TO_USE_BLOOM)
|
||||||
_filter = new DecayingHashSet(ctx, HALFLIFE_MS, 16, "TunnelIVV"); // appx. 4MB max
|
_filter = new DecayingHashSet(ctx, HALFLIFE_MS, 16, "TunnelIVV"); // appx. 4MB max
|
||||||
else if (KBps >= MIN_SHARE_KBPS_FOR_HUGE_BLOOM)
|
else if (KBps >= MIN_SHARE_KBPS_FOR_HUGE_BLOOM && maxMemory >= MIN_MEM_FOR_HUGE_BLOOM)
|
||||||
_filter = new DecayingBloomFilter(ctx, HALFLIFE_MS, 16, "TunnelIVV", 25); // 8MB fixed
|
_filter = new DecayingBloomFilter(ctx, HALFLIFE_MS, 16, "TunnelIVV", 25); // 8MB fixed
|
||||||
else if (KBps >= MIN_SHARE_KBPS_FOR_BIG_BLOOM)
|
else if (KBps >= MIN_SHARE_KBPS_FOR_BIG_BLOOM && maxMemory >= MIN_MEM_FOR_BIG_BLOOM)
|
||||||
_filter = new DecayingBloomFilter(ctx, HALFLIFE_MS, 16, "TunnelIVV", 24); // 4MB fixed
|
_filter = new DecayingBloomFilter(ctx, HALFLIFE_MS, 16, "TunnelIVV", 24); // 4MB fixed
|
||||||
else
|
else
|
||||||
_filter = new DecayingBloomFilter(ctx, HALFLIFE_MS, 16, "TunnelIVV"); // 2MB fixed
|
_filter = new DecayingBloomFilter(ctx, HALFLIFE_MS, 16, "TunnelIVV"); // 2MB fixed
|
||||||
|
Reference in New Issue
Block a user