diff --git a/Main/SOGo.m b/Main/SOGo.m index 9c0c18876..8a2c85885 100644 --- a/Main/SOGo.m +++ b/Main/SOGo.m @@ -425,6 +425,8 @@ static BOOL debugLeaks; { static NSArray *runLoopModes = nil; static BOOL debugOn = NO; + + SOGoSystemDefaults *sd; WOResponse *resp; NSDate *startDate; NSString *path; @@ -438,6 +440,7 @@ static BOOL debugLeaks; startDate = [NSDate date]; } + sd = [SOGoSystemDefaults sharedSystemDefaults]; cache = [SOGoCache sharedCache]; #ifdef GNUSTEP_BASE_LIBRARY if (debugLeaks) @@ -455,7 +458,7 @@ static BOOL debugLeaks; // We check for rate-limiting settings - ignore anything actually // sent to /SOGo/ (so unauthenticated requests). path = [_request requestHandlerPath]; - if ([path length]) + if ([path length] && [sd maximumRequestCount] > 0) { NSDictionary *requestCount; NSString *username; @@ -473,12 +476,8 @@ static BOOL debugLeaks; if (requestCount) { - SOGoSystemDefaults *sd; - unsigned int current_time, start_time, delta, block_time, request_count; - sd = [SOGoSystemDefaults sharedSystemDefaults]; - current_time = [[NSCalendarDate date] timeIntervalSince1970]; start_time = [[requestCount objectForKey: @"InitialDate"] unsignedIntValue]; delta = current_time - start_time;