Commit 43258541 authored by Simon Morlat's avatar Simon Morlat
Browse files

fix double notification of auth_info_requested()

parent aacd7bb5
......@@ -727,10 +727,12 @@ static void auth_failure(SalOp *op, SalAuthInfo* info) {
LinphoneAuthInfo *ai=(LinphoneAuthInfo*)linphone_core_find_auth_info(lc,info->realm,info->username,info->domain);
if (ai){
ms_message("%s/%s/%s authentication fails.",info->realm,info->username,info->domain);
/*ask again for password if auth info was already supplied but apparently not working*/
if (lc->vtable.auth_info_requested) {
lc->vtable.auth_info_requested(lc,info->realm,info->username,info->domain);
}
}
if (lc->vtable.auth_info_requested) {
lc->vtable.auth_info_requested(lc,info->realm,info->username,info->domain);
}
}
static void register_success(SalOp *op, bool_t registered){
......
......@@ -304,7 +304,7 @@ static void authenticated_register_with_late_credentials(){
counters = get_stats(mgr->lc);
register_with_refresh_base_2(mgr->lc,FALSE,auth_domain,route,TRUE,transport);
CU_ASSERT_EQUAL(counters->number_of_auth_info_requested,2); /*1 registration error = 2 auth requested*/
CU_ASSERT_EQUAL(counters->number_of_auth_info_requested,1);
linphone_core_manager_destroy(mgr);
}
......@@ -314,7 +314,7 @@ static void authenticated_register_with_wrong_late_credentials(){
LCSipTransports transport = {5070,5070,0,5071};
char route[256];
const char* saved_test_passwd=test_password;
char* wrong_passwd="mot de pass tout pourrit";
char* wrong_passwd="mot de pass tout pourri";
test_password=wrong_passwd;
......@@ -324,7 +324,7 @@ static void authenticated_register_with_wrong_late_credentials(){
counters = get_stats(mgr->lc);
register_with_refresh_base_3(mgr->lc,FALSE,auth_domain,route,TRUE,transport,LinphoneRegistrationFailed);
CU_ASSERT_EQUAL(counters->number_of_auth_info_requested,3);
CU_ASSERT_EQUAL(counters->number_of_auth_info_requested,2);
CU_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationFailed,2);
CU_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationProgress,2);
test_password=saved_test_passwd;
......
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