This repository was archived by the owner on Feb 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -257,8 +257,8 @@ - (SNTSyncStatusType)preflightOnly:(BOOL)preflightOnly {
257257 return [self eventUploadWithSyncState: syncState];
258258 }
259259
260- LOGE (@" Preflight failed, will try again once %@ is reachable" ,
261- [[SNTConfigurator configurator ] syncBaseURL ].absoluteString );
260+ SLOGE (@" Preflight failed, will try again once %@ is reachable" ,
261+ [[SNTConfigurator configurator ] syncBaseURL ].absoluteString );
262262 [self startReachability ];
263263 return SNTSyncStatusTypePreflightFailed;
264264}
@@ -386,6 +386,7 @@ - (SNTSyncState *)createSyncStateWithStatus:(SNTSyncStatusType *)status {
386386- (void )setReachable : (BOOL )reachable {
387387 _reachable = reachable;
388388 if (reachable) {
389+ LOGD (@" Internet connection has been restored, triggering a new sync." );
389390 [self stopReachability ];
390391 [self sync ];
391392 }
Original file line number Diff line number Diff line change 1414
1515#import " Source/santasyncservice/SNTSyncStage.h"
1616
17+ #include < Foundation/Foundation.h>
1718#import < MOLXPCConnection/MOLXPCConnection.h>
1819
1920#import " Source/common/SNTCommonEnums.h"
@@ -176,6 +177,11 @@ - (NSData *)dataFromRequest:(NSURLRequest *)request
176177 data = [self performRequest: request timeout: timeout response: &response error: &requestError];
177178 if (response.statusCode == 200 ) break ;
178179
180+ // If the original request failed because of a "No network" error, break out of the loop,
181+ // subsequent retries are pointless and the entire sync will be retried once a connection
182+ // is established.
183+ if (requestError.code == NSURLErrorNotConnectedToInternet) break ;
184+
179185 // If the original request failed because of an auth error, attempt to get a new XSRF token and
180186 // try again. Unfortunately some servers cause NSURLSession to return 'client cert required' or
181187 // 'could not parse response' when a 403 occurs and SSL cert auth is enabled.
You can’t perform that action at this time.
0 commit comments