Commit 798bd065 authored by Simon Morlat's avatar Simon Morlat
Browse files

prevent double notification of network reachable true or false.

parent 90ff3d47
......@@ -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);
......
......@@ -5555,6 +5555,8 @@ static void set_network_reachable(LinphoneCore* lc,bool_t isReachable, time_t cu
// 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){
LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)elem->data;
......@@ -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
......
......@@ -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){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment