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:)]) {
|
if ([self.delegate respondsToSelector:@selector(imageManager:shouldBlockFailedURL:withError:)]) {
|
||||||
shouldBlockFailedURL = [self.delegate imageManager:self shouldBlockFailedURL:url withError:error];
|
shouldBlockFailedURL = [self.delegate imageManager:self shouldBlockFailedURL:url withError:error];
|
||||||
} else {
|
} else {
|
||||||
NSString *domain = error.domain;
|
shouldBlockFailedURL = ( error.code != NSURLErrorNotConnectedToInternet
|
||||||
NSInteger code = error.code;
|
&& error.code != NSURLErrorCancelled
|
||||||
if ([domain isEqualToString:NSURLErrorDomain]) {
|
&& error.code != NSURLErrorTimedOut
|
||||||
shouldBlockFailedURL = ( code != NSURLErrorNotConnectedToInternet
|
&& error.code != NSURLErrorInternationalRoamingOff
|
||||||
&& code != NSURLErrorCancelled
|
&& error.code != NSURLErrorDataNotAllowed
|
||||||
&& code != NSURLErrorTimedOut
|
&& error.code != NSURLErrorCannotFindHost
|
||||||
&& code != NSURLErrorInternationalRoamingOff
|
&& error.code != NSURLErrorCannotConnectToHost
|
||||||
&& code != NSURLErrorDataNotAllowed
|
&& error.code != NSURLErrorNetworkConnectionLost);
|
||||||
&& code != NSURLErrorCannotFindHost
|
|
||||||
&& code != NSURLErrorCannotConnectToHost
|
|
||||||
&& code != NSURLErrorNetworkConnectionLost);
|
|
||||||
} else {
|
|
||||||
// Custom loader, don't do extra error code check
|
|
||||||
shouldBlockFailedURL = NO;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return shouldBlockFailedURL;
|
return shouldBlockFailedURL;
|
||||||
|
|
Loading…
Reference in New Issue