fix regression in some tests not wanting to register within linphone_core_manager_new(), due to register going out while stun resolution is in progress.

This commit is contained in:
Simon Morlat 2016-02-29 22:00:27 +01:00
parent fd74e2f10a
commit 4644ade096
2 changed files with 10 additions and 3 deletions

View file

@ -244,7 +244,7 @@ int sal_message_send(SalOp *op, const char *from, const char *to, const char* co
belle_sip_request_t* req;
char content_type_raw[256];
size_t content_length = msg?strlen(msg):0;
time_t curtime=time(NULL);
time_t curtime = ms_time(NULL);
uint8_t *multipartEncryptedMessage = NULL;
const char *body;
int retval;

View file

@ -344,10 +344,13 @@ void linphone_core_manager_start(LinphoneCoreManager *mgr, int check_for_proxies
int proxy_count;
/*BC_ASSERT_EQUAL(ms_list_size(linphone_core_get_proxy_config_list(lc)),proxy_count, int, "%d");*/
if (check_for_proxies) /**/
if (check_for_proxies){ /**/
proxy_count=ms_list_size(linphone_core_get_proxy_config_list(mgr->lc));
else
}else{
proxy_count=0;
/*this is to prevent registration to go on*/
linphone_core_set_network_reachable(mgr->lc, FALSE);
}
if (proxy_count){
#define REGISTER_TIMEOUT 20 /* seconds */
@ -370,6 +373,10 @@ void linphone_core_manager_start(LinphoneCoreManager *mgr, int check_for_proxies
/*before we go, ensure that the stun server is resolved, otherwise all ice related test will fail*/
BC_ASSERT_TRUE(wait_for_stun_resolution(mgr));
}
if (!check_for_proxies){
/*now that stun server resolution is done, we can start registering*/
linphone_core_set_network_reachable(mgr->lc, TRUE);
}
}
LinphoneCoreManager* linphone_core_manager_new( const char* rc_file) {