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)]) {
|
if ([request.HTTPBodyStream conformsToProtocol:@protocol(NSCopying)]) {
|
||||||
return [request.HTTPBodyStream copy];
|
return [request.HTTPBodyStream copy];
|
||||||
|
} else {
|
||||||
|
[self cancelConnection];
|
||||||
|
|
||||||
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.error = [NSError errorWithDomain:AFNetworkingErrorDomain code:NSURLErrorCancelled userInfo:nil];
|
|
||||||
|
|
||||||
[self.outputStream close];
|
|
||||||
|
|
||||||
[self finish];
|
|
||||||
|
|
||||||
self.connection = nil;
|
|
||||||
|
|
||||||
return nil;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSURLRequest *)connection:(NSURLConnection *)connection
|
- (NSURLRequest *)connection:(NSURLConnection *)connection
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue