Refactoring failure case for connection:needNewBodyStream:
This commit is contained in:
parent
38c49e1532
commit
fa0c8b8ddc
1 changed files with 4 additions and 10 deletions
|
|
@ -703,17 +703,11 @@ didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
|
|||
{
|
||||
if ([request.HTTPBodyStream conformsToProtocol:@protocol(NSCopying)]) {
|
||||
return [request.HTTPBodyStream copy];
|
||||
}
|
||||
|
||||
self.error = [NSError errorWithDomain:AFNetworkingErrorDomain code:NSURLErrorCancelled userInfo:nil];
|
||||
|
||||
[self.outputStream close];
|
||||
|
||||
[self finish];
|
||||
|
||||
self.connection = nil;
|
||||
} else {
|
||||
[self cancelConnection];
|
||||
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSURLRequest *)connection:(NSURLConnection *)connection
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue