Improved reachability check, detects severed internet connections.
This commit is contained in:
parent
76255d3f04
commit
3e4725bb3e
1 changed files with 5 additions and 1 deletions
|
|
@ -222,7 +222,11 @@ static NSString * AFPropertyListStringFromParameters(NSDictionary *parameters) {
|
|||
static void AFReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNetworkReachabilityFlags flags, void *info) {
|
||||
if (info) {
|
||||
AFNetworkReachabilityStatusBlock block = (AFNetworkReachabilityStatusBlock)info;
|
||||
BOOL isNetworkReachable = (flags & kSCNetworkReachabilityFlagsReachable);
|
||||
|
||||
BOOL isReachable = ((flags & kSCNetworkFlagsReachable) != 0);
|
||||
BOOL needsConnection = ((flags & kSCNetworkFlagsConnectionRequired) != 0);
|
||||
|
||||
BOOL isNetworkReachable = (isReachable && !needsConnection);
|
||||
block(isNetworkReachable);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue