From 2115c46fbbd702bd66442537f6e3b66993a987fa Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 7 Apr 2016 14:22:17 -0400 Subject: [PATCH] (fix) rename the start var to avoid potential SOPE confusion --- ActiveSync/SOGoActiveSyncDispatcher+Sync.m | 4 ++-- ActiveSync/SOGoActiveSyncDispatcher.h | 3 ++- ActiveSync/SOGoActiveSyncDispatcher.m | 13 +++++++++---- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ActiveSync/SOGoActiveSyncDispatcher+Sync.m b/ActiveSync/SOGoActiveSyncDispatcher+Sync.m index 5ec91c653..c5b82284b 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher+Sync.m +++ b/ActiveSync/SOGoActiveSyncDispatcher+Sync.m @@ -1906,7 +1906,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // We enter our loop detection change for (i = 0; i < (heartbeatInterval/internalInterval); i++) { - if (shouldTerminate) + if ([self easShouldTerminate]) break; s = [NSMutableString string]; @@ -1948,7 +1948,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. { total_sleep = 0; - while (!shouldTerminate && total_sleep < internalInterval) + while (![self easShouldTerminate] && total_sleep < internalInterval) { // We check if we must break the current synchronization since an other Sync // has just arrived. diff --git a/ActiveSync/SOGoActiveSyncDispatcher.h b/ActiveSync/SOGoActiveSyncDispatcher.h index 4b8937e0f..74f715ed2 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher.h +++ b/ActiveSync/SOGoActiveSyncDispatcher.h @@ -37,7 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @class NSURL; @class NSNumber; -static volatile BOOL shouldTerminate = NO; +static volatile BOOL easShouldTerminate = NO; @interface SOGoActiveSyncDispatcher : NSObject { @@ -63,5 +63,6 @@ static volatile BOOL shouldTerminate = NO; - (NSURL *) folderTableURL; - (void) ensureFolderTableExists; +- (BOOL) easShouldTerminate; @end diff --git a/ActiveSync/SOGoActiveSyncDispatcher.m b/ActiveSync/SOGoActiveSyncDispatcher.m index 6d1188d52..67b31a03d 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher.m +++ b/ActiveSync/SOGoActiveSyncDispatcher.m @@ -149,7 +149,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. void handle_eas_terminate(int signum) { NSLog(@"Forcing termination of EAS loop."); - shouldTerminate = YES; + easShouldTerminate = YES; [[WOCoreApplication application] terminateAfterTimeInterval: 1]; } @@ -171,7 +171,7 @@ void handle_eas_terminate(int signum) imapFolderGUIDS = nil; syncRequest = nil; - shouldTerminate = NO; + easShouldTerminate = NO; signal(SIGTERM, handle_eas_terminate); return self; @@ -2139,7 +2139,7 @@ void handle_eas_terminate(int signum) // We enter our loop detection change for (i = 0; i < (heartbeatInterval/internalInterval); i++) { - if (shouldTerminate) + if (easShouldTerminate) break; pool = [[NSAutoreleasePool alloc] init]; @@ -2179,7 +2179,7 @@ void handle_eas_terminate(int signum) { total_sleep = 0; - while (!shouldTerminate && total_sleep < internalInterval) + while (!easShouldTerminate && total_sleep < internalInterval) { // We check if we must break the current ping request since an other ping request // has just arrived. @@ -3452,4 +3452,9 @@ void handle_eas_terminate(int signum) [cm releaseChannel: channel]; } +- (BOOL) easShouldTerminate +{ + return easShouldTerminate; +} + @end