From 6eeff52a6201e5a368304cc6aaa43f9e221fbfd2 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 19 May 2015 15:09:33 +0200 Subject: [PATCH] remove original auth info from testers --- tester/accountmanager.c | 9 +++++++++ tester/message_tester.c | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tester/accountmanager.c b/tester/accountmanager.c index d46c2064d..85fbc4045 100644 --- a/tester/accountmanager.c +++ b/tester/accountmanager.c @@ -187,6 +187,10 @@ LinphoneAddress *account_manager_check_account(AccountManager *m, LinphoneProxyC LinphoneAuthInfo *ai; char *tmp; bool_t create_account=FALSE; + const LinphoneAuthInfo *original_ai = linphone_core_find_auth_info(lc + ,NULL + , linphone_address_get_username(id_addr) + , linphone_address_get_domain(id_addr)); if (!account){ account=account_new(id_addr,m->unique_id); @@ -203,6 +207,11 @@ LinphoneAddress *account_manager_check_account(AccountManager *m, LinphoneProxyC if (create_account){ account_create_on_server(account,cfg); } + + /*remove previous auth info to avoid mismatching*/ + if (original_ai) + linphone_core_remove_auth_info(lc,original_ai); + ai=linphone_auth_info_new(linphone_address_get_username(account->modified_identity), NULL, account->password,NULL,NULL,linphone_address_get_domain(account->modified_identity)); diff --git a/tester/message_tester.c b/tester/message_tester.c index 7e27f0ff4..b50c9d2d3 100644 --- a/tester/message_tester.c +++ b/tester/message_tester.c @@ -250,12 +250,12 @@ static void text_message_with_credential_from_auth_cb(void) { LinphoneCoreVTable* vtable = linphone_core_v_table_new(); LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); - text_message_with_credential_from_auth_cb_auth_info=linphone_auth_info_clone((LinphoneAuthInfo*)(linphone_core_get_auth_info_list(marie->lc)->data)); + text_message_with_credential_from_auth_cb_auth_info=linphone_auth_info_clone((LinphoneAuthInfo*)(linphone_core_get_auth_info_list(pauline->lc)->data)); /*to force cb to be called*/ - linphone_core_clear_all_auth_info(marie->lc); + linphone_core_clear_all_auth_info(pauline->lc); vtable->auth_info_requested=text_message_with_credential_from_auth_cb_auth_info_requested; - linphone_core_add_listener(marie->lc, vtable); + linphone_core_add_listener(pauline->lc, vtable); to = linphone_address_as_string(marie->identity); chat_room = linphone_core_create_chat_room(pauline->lc,to); @@ -669,7 +669,7 @@ static void printHex(char *title, uint8_t *data, uint32_t length) { sprintf (debug_string, "0x%02x, ", data[i]); debug_string+=6; } - debug_string = '\0'; + *debug_string = '\0'; ms_message("%s", debug_string_buffer); }