fix double notification of auth_info_requested()

This commit is contained in:
Simon Morlat 2014-02-11 11:28:07 +01:00
parent aacd7bb5a2
commit 4325854123
2 changed files with 8 additions and 6 deletions

View file

@ -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){

View file

@ -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;