From 4644ade096d9c504409c9be48c157e26df042959 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 29 Feb 2016 22:00:27 +0100 Subject: [PATCH] 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. --- coreapi/bellesip_sal/sal_op_message.c | 2 +- tester/tester.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/coreapi/bellesip_sal/sal_op_message.c b/coreapi/bellesip_sal/sal_op_message.c index 0c746aba7..baf69a9eb 100644 --- a/coreapi/bellesip_sal/sal_op_message.c +++ b/coreapi/bellesip_sal/sal_op_message.c @@ -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; diff --git a/tester/tester.c b/tester/tester.c index c361ae34a..b919bf32f 100644 --- a/tester/tester.c +++ b/tester/tester.c @@ -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) {