Merge pull request #195 from cbess/patch-1
Improved reachability check, detects severed internet connections.
This commit is contained in:
commit
37559c792c
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 & kSCNetworkReachabilityFlagsReachable) != 0);
|
||||
BOOL needsConnection = ((flags & kSCNetworkReachabilityFlagsConnectionRequired) != 0);
|
||||
BOOL isNetworkReachable = (isReachable && !needsConnection);
|
||||
|
||||
block(isNetworkReachable);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue