Revert "Merge branch 'nolanw-request-delegate-gets-failed-auth-challenge'"

This reverts commit d6510d963f, reversing
changes made to a1e2061106.
This commit is contained in:
Blake Watters
2012-01-09 19:53:23 -05:00
parent 722d08095b
commit 89a4e579fd
2 changed files with 6 additions and 14 deletions

View File

@@ -469,9 +469,4 @@ typedef enum {
*/
- (void)requestDidTimeout:(RKRequest *)request;
/**
* Sent when a request fails authentication
*/
- (void)request:(RKRequest *)request didFailAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;
@end

View File

@@ -51,7 +51,9 @@ extern NSString* cacheURLKey;
- (id)initWithRequest:(RKRequest*)request {
self = [self init];
if (self) {
_request = [request retain];
// We don't retain here as we're letting RKRequestQueue manage
// request ownership
_request = request;
}
return self;
@@ -71,7 +73,7 @@ extern NSString* cacheURLKey;
- (id)initWithSynchronousRequest:(RKRequest*)request URLResponse:(NSHTTPURLResponse*)URLResponse body:(NSData*)body error:(NSError*)error {
self = [super init];
if (self) {
_request = [request retain];
_request = request;
_httpURLResponse = [URLResponse retain];
_failureError = [error retain];
_body = [[NSMutableData dataWithData:body] retain];
@@ -82,8 +84,6 @@ extern NSString* cacheURLKey;
}
- (void)dealloc {
[_request release];
_request = nil;
[_httpURLResponse release];
_httpURLResponse = nil;
[_body release];
@@ -151,11 +151,8 @@ extern NSString* cacheURLKey;
[[challenge sender] useCredential:newCredential
forAuthenticationChallenge:challenge];
} else {
RKLogWarning(@"Failed authentication challenge after %ld failures", (long) [challenge previousFailureCount]);
if ([[_request delegate] respondsToSelector:@selector(request:didFailAuthenticationChallenge:)]) {
[[_request delegate] request:_request didFailAuthenticationChallenge:challenge];
}
[[challenge sender] cancelAuthenticationChallenge:challenge];
RKLogWarning(@"Failed authentication challenge after %ld failures", (long) [challenge previousFailureCount]);
[[challenge sender] cancelAuthenticationChallenge:challenge];
}
}