Skip to content

Commit

Permalink
MXHTTPClient: Log: Track potential expected session invalidation (see…
Browse files Browse the repository at this point in the history
…n on iOS10 beta)

See element-hq/element-ios#490
  • Loading branch information
manuroe committed Aug 1, 2016
1 parent 0580ed3 commit f70f40d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions MatrixSDK/Utils/MXHTTPClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ -(id)initWithBaseURL:(NSString *)baseURL accessToken:(NSString *)access_token an

[self setUpNetworkReachibility];
[self setUpSSLCertificatesHandler];

// Track potential expected session invalidation (seen on iOS10 beta)
[httpManager setSessionDidBecomeInvalidBlock:^(NSURLSession * _Nonnull session, NSError * _Nonnull error) {

// TODO: Do something like instantiate a new httpManager
NSLog(@"[MXHTTPClient] ERROR: SessionDidBecomeInvalid: %@: %@", session, error);
}];
}
return self;
}
Expand Down Expand Up @@ -507,6 +514,7 @@ - (void)cleanupBackgroundTask
#pragma mark - Private methods
- (void)cancel
{
NSLog(@"[MXHTTPClient] cancel");
[httpManager invalidateSessionCancelingTasks:YES];
}

Expand Down

0 comments on commit f70f40d

Please sign in to comment.