forked from mirrors/linphone-iphone
Merge branch 'new_ui' of git://git.linphone.org/linphone-iphone into buschjaeger_new_ui
Conflicts: Classes/LinphoneCoreSettingsStore.m Classes/SettingsViewController.m
This commit is contained in:
commit
258d9f7b2f
1 changed files with 11 additions and 3 deletions
|
|
@ -719,7 +719,11 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
|
|||
|
||||
- (void)setupNetworkReachabilityCallback {
|
||||
SCNetworkReachabilityContext *ctx=NULL;
|
||||
const char *nodeName="linphone.org";
|
||||
//any internet cnx
|
||||
struct sockaddr_in zeroAddress;
|
||||
bzero(&zeroAddress, sizeof(zeroAddress));
|
||||
zeroAddress.sin_len = sizeof(zeroAddress);
|
||||
zeroAddress.sin_family = AF_INET;
|
||||
|
||||
if (proxyReachability) {
|
||||
[LinphoneLogger logc:LinphoneLoggerLog format:"Cancelling old network reachability"];
|
||||
|
|
@ -728,8 +732,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
|
|||
proxyReachability = nil;
|
||||
}
|
||||
|
||||
proxyReachability = SCNetworkReachabilityCreateWithName(nil, nodeName);
|
||||
|
||||
proxyReachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)&zeroAddress);
|
||||
|
||||
if (!SCNetworkReachabilitySetCallback(proxyReachability, (SCNetworkReachabilityCallBack)networkReachabilityCallBack, ctx)){
|
||||
[LinphoneLogger logc:LinphoneLoggerError format:"Cannot register reachability cb: %s", SCErrorString(SCError())];
|
||||
|
|
@ -739,6 +742,11 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
|
|||
[LinphoneLogger logc:LinphoneLoggerError format:"Cannot register schedule reachability cb: %s", SCErrorString(SCError())];
|
||||
return;
|
||||
}
|
||||
// this check is to know network connectivity right now without waiting for a change. Don'nt remove it unless you have good reason. Jehan
|
||||
SCNetworkReachabilityFlags flags;
|
||||
if (SCNetworkReachabilityGetFlags(proxyReachability, &flags)) {
|
||||
networkReachabilityCallBack(proxyReachability,flags,nil);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue