From ecfc54a0af916f431e0b4a56e37bc5145115cd05 Mon Sep 17 00:00:00 2001 From: Hivert Quentin Date: Wed, 26 Mar 2025 09:26:35 +0100 Subject: [PATCH] add logs --- ActiveSync/SOGoActiveSyncDispatcher.m | 28 ++++++++++++++++++--------- SoObjects/SOGo/SOGoSystemDefaults.m | 6 ++++++ 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/ActiveSync/SOGoActiveSyncDispatcher.m b/ActiveSync/SOGoActiveSyncDispatcher.m index a1a03efe9..e8c9f169e 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher.m +++ b/ActiveSync/SOGoActiveSyncDispatcher.m @@ -2471,28 +2471,37 @@ void handle_eas_terminate(int signum) [[o properties] setObject: processIdentifier forKey: @"PingRequest"]; [o save]; + NSLog(@"EASLOG: processPing, load defaults"); defaults = [SOGoSystemDefaults sharedSystemDefaults]; defaultInterval = [defaults maximumPingInterval]; internalInterval = [defaults internalSyncInterval]; sleepInterval = (internalInterval < 5) ? 5 : internalInterval; + NSLog(@"EASLOG: processPing, defaults found defaultInterval: %@, internalInterval: %@, sleepInterval: %@", defaultInterval, internalInterval, sleepInterval); if (theDocumentElement) + { heartbeatInterval = [[[(id)[theDocumentElement getElementsByTagName: @"HeartbeatInterval"] lastObject] textValue] intValue]; + NSLog(@"EASLOG: processPing, heartbeatInterval found in document: %@", heartbeatInterval); + } else + { heartbeatInterval = defaultInterval; + NSLog(@"EASLOG: processPing, heartbeatInterval NOT found in document: %@", heartbeatInterval); + } if (heartbeatInterval > defaultInterval || heartbeatInterval == 0) - { - heartbeatInterval = defaultInterval; - status = 5; - } + { + heartbeatInterval = defaultInterval; + status = 5; + } else - { - if (heartbeatInterval < internalInterval) - heartbeatInterval = internalInterval; + { + if (heartbeatInterval < internalInterval) + heartbeatInterval = internalInterval; - status = 1; - } + status = 1; + } + NSLog(@"EASLOG: processPing, heartbeatInterval final value: %@", heartbeatInterval); // We build the list of folders to "ping". When the payload is empty, we use the list // of "cached" folders. @@ -2607,6 +2616,7 @@ void handle_eas_terminate(int signum) { // We check if we must break the current ping request since an other ping request // has just arrived. + NSLog(@"EASLOG: processPing, while loop for changes start. total_sleep: %@, internalInterval: %@", total_sleep, internalInterval); pingRequestInCache = [[self globalMetadataForDevice] objectForKey: @"PingRequest"]; if (pingRequestInCache && ![pingRequestInCache isEqualToString: processIdentifier]) { diff --git a/SoObjects/SOGo/SOGoSystemDefaults.m b/SoObjects/SOGo/SOGoSystemDefaults.m index b47fbf6d6..6f0f43dc7 100644 --- a/SoObjects/SOGo/SOGoSystemDefaults.m +++ b/SoObjects/SOGo/SOGoSystemDefaults.m @@ -1025,7 +1025,13 @@ NSComparisonResult languageSort(id el1, id el2, void *context) v = [self integerForKey: @"SOGoInternalSyncInterval"]; if (!v) + { + NSLog(@"EASLOG: SOGoInternalSyncInterval didn't find value in conf, go with default 10"); v = 10; + } + else { + NSLog(@"EASLOG: SOGoInternalSyncInterval found, value is %@", v); + } return v; }