Skip to content

Commit 786b1ef

Browse files
committedAug 11, 2013
Merge branch 'master' of github.com:AFNetworking/AFNetworking
2 parents 748260a + 95a51a4 commit 786b1ef

File tree

4 files changed

+8
-24
lines changed

4 files changed

+8
-24
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ profile
1717
DerivedData
1818
.idea/
1919
Tests/Pods
20+
Tests/Podfile.lock
2021
Tests/AFNetworking Tests.xcodeproj/xcshareddata/xcschemes/

‎AFNetworking/AFURLConnectionOperation.m

+5
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,11 @@ - (void)operationDidStart {
528528
});
529529

530530
if ([self isCancelled]) {
531+
NSDictionary *userInfo = nil;
532+
if ([self.request URL]) {
533+
userInfo = [NSDictionary dictionaryWithObject:[self.request URL] forKey:NSURLErrorFailingURLErrorKey];
534+
}
535+
self.error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorCancelled userInfo:userInfo];
531536
[self finish];
532537
}
533538
}

‎Tests/AFHTTPRequestOperationTests.m

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ - (void)testThatCancellationOfRequestOperationSetsError {
7676
}
7777

7878
- (void)testThatCancellationOfRequestOperationInvokesFailureCompletionBlock {
79+
[Expecta setAsynchronousTestTimeout:10.0];
80+
7981
__block NSError *blockError = nil;
8082

8183
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"/delay/5" relativeToURL:self.baseURL]];

‎Tests/Podfile.lock

-24
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.