* Streaming: Don't send RST on globally-blackisted conns

This commit is contained in:
zzz
2012-09-28 18:48:16 +00:00
parent e3133d88d7
commit 49b11e1f84

View File

@ -240,6 +240,7 @@ class ConnectionManager {
Hash h = from.calculateHash();
if ((_hourThrottler != null && _hourThrottler.isThrottled(h)) ||
(_dayThrottler != null && _dayThrottler.isThrottled(h)) ||
_globalBlacklist.contains(h) ||
(_defaultOptions.isAccessListEnabled() && !_defaultOptions.getAccessList().contains(h)) ||
(_defaultOptions.isBlacklistEnabled() && _defaultOptions.getBlacklist().contains(h))) {
// A signed RST packet + ElGamal + session tags is fairly expensive, so
@ -435,7 +436,7 @@ class ConnectionManager {
if (!_currentBlacklist.equals(hashes)) {
// rebuild _globalBlacklist when property changes
synchronized(_globalBlacklist) {
if (hashes != null) {
if (hashes.length() > 0) {
Set<Hash> newSet = new HashSet();
StringTokenizer tok = new StringTokenizer(hashes, ",; ");
while (tok.hasMoreTokens()) {