no DoS protection for intranet mode

This commit is contained in:
Michael Peter Christen 2012-01-25 12:13:03 +01:00
parent 0f443ac755
commit 88b86afc89

View File

@ -248,6 +248,7 @@ public class yacysearch {
|| sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_AUTODISABLED, true) || sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_AUTODISABLED, true)
|| clustersearch; || clustersearch;
global = global && indexReceiveGranted; // if the user does not want indexes from remote peers, it cannot be a global searchnn global = global && indexReceiveGranted; // if the user does not want indexes from remote peers, it cannot be a global searchnn
final boolean intranetMode = sb.isIntranetMode() || sb.isAllIPMode();
// increase search statistic counter // increase search statistic counter
if ( !global ) { if ( !global ) {
@ -298,7 +299,7 @@ public class yacysearch {
Log.logInfo("LOCAL_SEARCH", "ACCESS CONTROL: WHITELISTED CLIENT FROM " Log.logInfo("LOCAL_SEARCH", "ACCESS CONTROL: WHITELISTED CLIENT FROM "
+ client + client
+ " gets no search restrictions"); + " gets no search restrictions");
} else if ( !authenticated && !localhostAccess ) { } else if ( !authenticated && !localhostAccess && !intranetMode ) {
// in case that we do a global search or we want to fetch snippets, we check for DoS cases // in case that we do a global search or we want to fetch snippets, we check for DoS cases
synchronized ( trackerHandles ) { synchronized ( trackerHandles ) {
final int accInThreeSeconds = final int accInThreeSeconds =