Merge pull request #2580 from zhongwuzw/fix_fail_url_block_logical
Revert failed block processing logic
This commit is contained in:
commit
45b4d64bda
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue