From b115f2683437a1c019ee210f6e1ece722684d3f2 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Mon, 21 Mar 2016 08:19:40 -0400 Subject: [PATCH] (fix) make sure we don't consider SOGoMaximumRequestCount when it is 0 --- Main/SOGo.m | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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;