Merge pull request #972 from aburgel/needNewBodyStream_cancel

Register error if new bodyStream cannot be created
This commit is contained in:
Mattt Thompson 2013-05-08 10:10:55 -07:00
commit 38c49e1532

View file

@ -704,7 +704,15 @@ 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;
return nil;
}