Skip non-AFHTTPRequestOperations in AFHTTPClient -cancelAllHTTPOperationsWithMethod
This commit is contained in:
parent
f489189a76
commit
cac44aeb34
1 changed files with 6 additions and 2 deletions
|
|
@ -416,8 +416,12 @@ static void AFReachabilityCallback(SCNetworkReachabilityRef __unused target, SCN
|
|||
}
|
||||
|
||||
- (void)cancelAllHTTPOperationsWithMethod:(NSString *)method path:(NSString *)path {
|
||||
for (AFHTTPRequestOperation *operation in [self.operationQueue operations]) {
|
||||
if ((!method || [method isEqualToString:[[operation request] HTTPMethod]]) && [path isEqualToString:[[[operation request] URL] path]]) {
|
||||
for (NSOperation *operation in [self.operationQueue operations]) {
|
||||
if (![operation isKindOfClass:[AFHTTPRequestOperation class]]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((!method || [method isEqualToString:[[(AFHTTPRequestOperation *)operation request] HTTPMethod]]) && [path isEqualToString:[[[(AFHTTPRequestOperation *)operation request] URL] path]]) {
|
||||
[operation cancel];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue