prevent double notification of network reachable true or false.

This commit is contained in:
Simon Morlat 2013-08-28 11:23:47 +02:00
parent 90ff3d477a
commit 798bd06597
3 changed files with 14 additions and 7 deletions

View file

@ -76,6 +76,12 @@ int sal_register(SalOp *op, const char *proxy, const char *from, int expires){
belle_sip_request_t *req;
belle_sip_uri_t* req_uri;
if (op->refresher){
belle_sip_refresher_stop(op->refresher);
belle_sip_object_unref(op->refresher);
op->refresher=NULL;
}
op->type=SalOpRegister;
sal_op_set_from(op,from);
sal_op_set_to(op,from);

View file

@ -5554,6 +5554,8 @@ static void linphone_core_uninit(LinphoneCore *lc)
static void set_network_reachable(LinphoneCore* lc,bool_t isReachable, time_t curtime){
// second get the list of available proxies
const MSList *elem=linphone_core_get_proxy_config_list(lc);
if (lc->network_reachable==isReachable) return; // no change, ignore.
ms_message("Network state is now [%s]",isReachable?"UP":"DOWN");
for(;elem!=NULL;elem=elem->next){
@ -5569,9 +5571,8 @@ static void set_network_reachable(LinphoneCore* lc,bool_t isReachable, time_t cu
lc->netup_time=curtime;
lc->network_reachable=isReachable;
if (!lc->network_reachable) linphone_core_invalidate_friend_subscriptions(lc);
if(!isReachable) {
if (!lc->network_reachable){
linphone_core_invalidate_friend_subscriptions(lc);
sal_reset_transports(lc->sal);
}
#ifdef BUILD_UPNP

View file

@ -1312,10 +1312,10 @@ void linphone_proxy_config_set_state(LinphoneProxyConfig *cfg, LinphoneRegistrat
LinphoneCore *lc=cfg->lc;
ms_message("Proxy config [%p] for identity [%s] moving from state [%s] to [%s]" , cfg
, linphone_proxy_config_get_identity(cfg)
, linphone_registration_state_to_string(cfg->state)
, linphone_registration_state_to_string(state));
ms_message("Proxy config [%p] for identity [%s] moving from state [%s] to [%s]" , cfg,
linphone_proxy_config_get_identity(cfg),
linphone_registration_state_to_string(cfg->state),
linphone_registration_state_to_string(state));
if (cfg->state!=state || state==LinphoneRegistrationOk) { /*allow multiple notification of LinphoneRegistrationOk for refreshing*/
cfg->state=state;
if (lc && lc->vtable.registration_state_changed){