Skip to content

Commit

Permalink
small changes to attributes of DoS attack protection parameters
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5246 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Oct 3, 2008
1 parent 9ac16f5 commit d0bdcdd
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions htroot/yacy/search.java
Expand Up @@ -134,18 +134,15 @@ public static serverObjects respond(final httpRequestHeader header, final server
TreeSet<Long> trackerHandles = sb.remoteSearchTracker.get(client);
if (trackerHandles == null) trackerHandles = new TreeSet<Long>();
boolean block = false;
if (trackerHandles.tailSet(Long.valueOf(System.currentTimeMillis() - 6000)).size() > 1) try {
Thread.sleep(3000);
if (trackerHandles.tailSet(Long.valueOf(System.currentTimeMillis() - 3000)).size() > 1) {
block = true;
} catch (final InterruptedException e) { e.printStackTrace(); }
if (trackerHandles.tailSet(Long.valueOf(System.currentTimeMillis() - 60000)).size() > 12) try {
Thread.sleep(10000);
}
if (trackerHandles.tailSet(Long.valueOf(System.currentTimeMillis() - 60000)).size() > 12) {
block = true;
} catch (final InterruptedException e) { e.printStackTrace(); }
if (trackerHandles.tailSet(Long.valueOf(System.currentTimeMillis() - 600000)).size() > 36) try {
Thread.sleep(30000);
}
if (trackerHandles.tailSet(Long.valueOf(System.currentTimeMillis() - 600000)).size() > 36) {
block = true;
} catch (final InterruptedException e) { e.printStackTrace(); }
}
if (block) {
prop.put("links", "");
prop.put("linkcount", "0");
Expand Down

0 comments on commit d0bdcdd

Please sign in to comment.