File tree Expand file tree Collapse file tree 2 files changed +18
-19
lines changed Expand file tree Collapse file tree 2 files changed +18
-19
lines changed Original file line number Diff line number Diff line change @@ -124,22 +124,20 @@ - (void)saveRequests:(NSMutableArray *)requests
124124 */
125125- (NSMutableArray *)loadRequests
126126{
127- @synchronized (self) {
128- NSData *requestData = [NSData dataWithContentsOfFile: self .documentsFilePath];
129- if (requestData) {
130- NSError *error = nil ;
131- NSMutableArray *requests = [NSPropertyListSerialization
132- propertyListWithData: requestData
133- options: NSPropertyListMutableContainers
134- format: NULL error: &error];
135- if (error) {
136- LPLog (LPDebug, @" Error in loading requets: %@ " , error);
137- } else {
138- LPLog (LPDebug, @" Loaded %lu requests" , (unsigned long ) requests.count );
139- }
140-
141- return requests;
127+ NSData *requestData = [NSData dataWithContentsOfFile: self .documentsFilePath];
128+ if (requestData) {
129+ NSError *error = nil ;
130+ NSMutableArray *requests = [NSPropertyListSerialization
131+ propertyListWithData: requestData
132+ options: NSPropertyListMutableContainers
133+ format: NULL error: &error];
134+ if (error) {
135+ LPLog (LPDebug, @" Error in loading requets: %@ " , error);
136+ } else {
137+ LPLog (LPDebug, @" Loaded %lu requests" , (unsigned long ) requests.count );
142138 }
139+
140+ return requests;
143141 }
144142
145143 return [NSMutableArray new ];
Original file line number Diff line number Diff line change @@ -369,10 +369,11 @@ - (void)sendNow:(BOOL)async
369369 NSInteger httpStatusCode = completedOperation.HTTPStatusCode ;
370370 if (httpStatusCode == 408
371371 || (httpStatusCode >= 500 && httpStatusCode < 600 )
372- || err.code == kCFURLErrorCannotConnectToHost
373- || err.code == kCFURLErrorDNSLookupFailed
374- || err.code == kCFURLErrorNotConnectedToInternet
375- || err.code == kCFURLErrorTimedOut ) {
372+ || err.code == NSURLErrorBadServerResponse
373+ || err.code == NSURLErrorCannotConnectToHost
374+ || err.code == NSURLErrorDNSLookupFailed
375+ || err.code == NSURLErrorNotConnectedToInternet
376+ || err.code == NSURLErrorTimedOut) {
376377 NSLog (@" Leanplum: %@ " , err);
377378 [LeanplumRequest pushUnsentRequests: requestsToSend];
378379 } else {
You can’t perform that action at this time.
0 commit comments