maybe we have less problems with open connections to the server if we don't do BF forced sleeps (just a test)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6149 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent 34be6f82d2
commit d1083a6913

@ -342,6 +342,7 @@ public final class serverCore extends serverAbstractBusyThread implements server
final String cIP = clientAddress(controlSocket); final String cIP = clientAddress(controlSocket);
//System.out.println("server bfHosts=" + bfHost.toString()); //System.out.println("server bfHosts=" + bfHost.toString());
/*
if (bfHost.get(cIP) != null) { if (bfHost.get(cIP) != null) {
Integer attempts = bfHost.get(cIP); Integer attempts = bfHost.get(cIP);
if (attempts == null) attempts = Integer.valueOf(1); else attempts = Integer.valueOf(attempts.intValue() + 1); if (attempts == null) attempts = Integer.valueOf(1); else attempts = Integer.valueOf(attempts.intValue() + 1);
@ -349,12 +350,13 @@ public final class serverCore extends serverAbstractBusyThread implements server
this.log.logWarning("SLOWING DOWN ACCESS FOR BRUTE-FORCE PREVENTION FROM " + cIP + ", ATTEMPT " + attempts.intValue()); this.log.logWarning("SLOWING DOWN ACCESS FOR BRUTE-FORCE PREVENTION FROM " + cIP + ", ATTEMPT " + attempts.intValue());
// add a delay to make brute-force harder // add a delay to make brute-force harder
announceThreadBlockApply(); announceThreadBlockApply();
try {Thread.sleep(attempts.intValue() /*BFPATCH*/);} catch (final InterruptedException e) {} try {Thread.sleep(attempts.intValue());} catch (final InterruptedException e) {}
announceThreadBlockRelease(); announceThreadBlockRelease();
if ((attempts.intValue() >= 10) && (this.denyHost != null)) { if ((attempts.intValue() >= 10) && (this.denyHost != null)) {
this.denyHost.put(cIP, "deny"); this.denyHost.put(cIP, "deny");
} }
} }
*/
if ((this.denyHost == null) || (this.denyHost.get(cIP) == null)) { if ((this.denyHost == null) || (this.denyHost.get(cIP) == null)) {
// setting the timeout properly // setting the timeout properly

Loading…
Cancel
Save