Merge pull request #2580 from zhongwuzw/fix_fail_url_block_logical

Revert failed block processing logic
This commit is contained in:
DreamPiggy 2019-01-10 17:38:38 +08:00 committed by GitHub
commit 45b4d64bda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 15 deletions

View File

@ -374,21 +374,14 @@ static id<SDImageLoader> _defaultImageLoader;
if ([self.delegate respondsToSelector:@selector(imageManager:shouldBlockFailedURL:withError:)]) {
shouldBlockFailedURL = [self.delegate imageManager:self shouldBlockFailedURL:url withError:error];
} else {
NSString *domain = error.domain;
NSInteger code = error.code;
if ([domain isEqualToString:NSURLErrorDomain]) {
shouldBlockFailedURL = ( code != NSURLErrorNotConnectedToInternet
&& code != NSURLErrorCancelled
&& code != NSURLErrorTimedOut
&& code != NSURLErrorInternationalRoamingOff
&& code != NSURLErrorDataNotAllowed
&& code != NSURLErrorCannotFindHost
&& code != NSURLErrorCannotConnectToHost
&& code != NSURLErrorNetworkConnectionLost);
} else {
// Custom loader, don't do extra error code check
shouldBlockFailedURL = NO;
}
shouldBlockFailedURL = ( error.code != NSURLErrorNotConnectedToInternet
&& error.code != NSURLErrorCancelled
&& error.code != NSURLErrorTimedOut
&& error.code != NSURLErrorInternationalRoamingOff
&& error.code != NSURLErrorDataNotAllowed
&& error.code != NSURLErrorCannotFindHost
&& error.code != NSURLErrorCannotConnectToHost
&& error.code != NSURLErrorNetworkConnectionLost);
}
return shouldBlockFailedURL;