From 311f57d360d3b1c22455c3a9cba3bef115b8c502 Mon Sep 17 00:00:00 2001 From: orbiter Date: Mon, 21 Feb 2011 15:11:03 +0000 Subject: [PATCH] DoS to prevent online snippet fetch: allow read from cache. git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7508 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/yacysearch.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java index bb03e6dc2..5a53b7fa1 100644 --- a/htroot/yacysearch.java +++ b/htroot/yacysearch.java @@ -56,6 +56,7 @@ import net.yacy.kelondro.util.SetTools; import net.yacy.kelondro.util.ISO639; import de.anomic.crawler.CrawlProfile; +import de.anomic.crawler.CrawlProfile.CacheStrategy; import de.anomic.data.DidYouMean; import de.anomic.search.AccessTracker; import de.anomic.search.ContentDomain; @@ -255,7 +256,7 @@ public class yacysearch { // protection against too many remote server snippet loads (protects traffic on server) if (snippetFetchStrategy != null && snippetFetchStrategy.isAllowedToFetchOnline()) { if (accInTenMinutes >= 20 || accInOneMinute >= 4 || accInThreeSeconds >= 1) { - snippetFetchStrategy = null; + snippetFetchStrategy = CacheStrategy.CACHEONLY; Log.logWarning("LOCAL_SEARCH", "ACCESS CONTROL: CLIENT FROM " + client + ": " + accInOneSecond + "/1s, " + accInThreeSeconds + "/3s, " + accInOneMinute + "/60s, " + accInTenMinutes + "/600s, " + " requests, disallowed remote snippet loading"); } }