Commit 5c7330b1 authored by jehan's avatar jehan
Browse files

avoid 100 trying to reset op auth counters

parent 3da4777e
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<folderInfo id="0.2079208171." name="/" resourcePath=""> <folderInfo id="0.2079208171." name="/" resourcePath="">
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.2084203071" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain"> <toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.2084203071" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
<targetPlatform binaryParser="org.eclipse.cdt.core.MachO64;org.eclipse.cdt.core.ELF" id="org.eclipse.cdt.build.core.prefbase.toolchain.2084203071.81924294" name=""/> <targetPlatform binaryParser="org.eclipse.cdt.core.MachO64;org.eclipse.cdt.core.ELF" id="org.eclipse.cdt.build.core.prefbase.toolchain.2084203071.81924294" name=""/>
<builder arguments="-j4 CFLAGS=&quot;-g -Wall -Qunused-arguments&quot; CXXFLAGS=&quot;-g&quot;" command="make" id="org.eclipse.cdt.build.core.settings.default.builder.731584538" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/> <builder arguments="-j4 CFLAGS=&quot;-g -Wall -Qunused-arguments&quot; CXXFLAGS=&quot;-g&quot;" autoBuildTarget="all" cleanBuildTarget="clean" command="make" enableAutoBuild="false" enableCleanBuild="true" enabledIncrementalBuild="true" id="org.eclipse.cdt.build.core.settings.default.builder.731584538" incrementalBuildTarget="all" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="false" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.1252970003" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/> <tool id="org.eclipse.cdt.build.core.settings.holder.libs.1252970003" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.1371414073" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder"> <tool id="org.eclipse.cdt.build.core.settings.holder.1371414073" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.306286573" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/> <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.306286573" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
......
...@@ -146,13 +146,14 @@ void sal_process_authentication(SalOp *op) { ...@@ -146,13 +146,14 @@ void sal_process_authentication(SalOp *op) {
if (is_within_dialog) { if (is_within_dialog) {
belle_sip_object_unref(new_request); belle_sip_object_unref(new_request);
} }
}
/*always store auth info, for case of wrong credential*/
if (op->auth_info) sal_auth_info_delete(op->auth_info); if (op->auth_info) sal_auth_info_delete(op->auth_info);
if (auth_list){ if (auth_list){
auth_event=(belle_sip_auth_event_t*)(auth_list->data); auth_event=(belle_sip_auth_event_t*)(auth_list->data);
op->auth_info=sal_auth_info_create(auth_event); op->auth_info=sal_auth_info_create(auth_event);
belle_sip_list_free_with_data(auth_list,(void (*)(void*))belle_sip_auth_event_destroy); belle_sip_list_free_with_data(auth_list,(void (*)(void*))belle_sip_auth_event_destroy);
} }
}
} }
static void process_dialog_terminated(void *sal, const belle_sip_dialog_terminated_event_t *event){ static void process_dialog_terminated(void *sal, const belle_sip_dialog_terminated_event_t *event){
...@@ -345,7 +346,7 @@ static void process_response_event(void *user_ctx, const belle_sip_response_even ...@@ -345,7 +346,7 @@ static void process_response_event(void *user_ctx, const belle_sip_response_even
if (op->auth_info) op->base.root->callbacks.auth_failure(op,op->auth_info); if (op->auth_info) op->base.root->callbacks.auth_failure(op,op->auth_info);
break; break;
} }
if (response_code !=401 && response_code !=407 && response_code !=403) { if (response_code >= 180 && response_code !=401 && response_code !=407 && response_code !=403) {
/*not an auth request*/ /*not an auth request*/
op->auth_requests=0; op->auth_requests=0;
} }
......
oRTP @ b03acc0a
Subproject commit 38eccb648fa80274082fb1aa299edcd37004f1cf Subproject commit b03acc0a37ee64a12e9854e2ea4b781a9412240d
...@@ -1410,41 +1410,53 @@ static void call_established_with_rejected_reinvite_with_error(void) { ...@@ -1410,41 +1410,53 @@ static void call_established_with_rejected_reinvite_with_error(void) {
linphone_core_manager_destroy(pauline); linphone_core_manager_destroy(pauline);
} }
static void call_rejected_because_wrong_credentials_with_params(const char* user_agent) { static void call_rejected_because_wrong_credentials_with_params(const char* user_agent,bool_t enable_auth_req_cb) {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneAuthInfo* good_auth_info=linphone_auth_info_clone((LinphoneAuthInfo*)(linphone_core_get_auth_info_list(marie->lc)->data)); LinphoneAuthInfo* good_auth_info=linphone_auth_info_clone((LinphoneAuthInfo*)(linphone_core_get_auth_info_list(marie->lc)->data));
LinphoneAuthInfo* wrong_auth_info=linphone_auth_info_clone(good_auth_info); LinphoneAuthInfo* wrong_auth_info=linphone_auth_info_clone(good_auth_info);
bool_t result=FALSE;
linphone_auth_info_set_passwd(wrong_auth_info,"passecretdutout");
linphone_core_clear_all_auth_info(marie->lc);
if (user_agent) { if (user_agent) {
linphone_core_set_user_agent(marie->lc,user_agent,NULL); linphone_core_set_user_agent(marie->lc,user_agent,NULL);
} }
linphone_core_clear_all_auth_info(marie->lc); if (!enable_auth_req_cb) {
marie->lc->vtable.auth_info_requested=NULL;
linphone_core_add_auth_info(marie->lc,wrong_auth_info);
}
CU_ASSERT_PTR_NOT_NULL(linphone_core_invite_address(marie->lc,marie->identity)); CU_ASSERT_PTR_NOT_NULL(linphone_core_invite_address(marie->lc,marie->identity));
CU_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_auth_info_requested,1)); result=wait_for(marie->lc,marie->lc,&marie->stat.number_of_auth_info_requested,1);
linphone_auth_info_set_passwd(wrong_auth_info,"passecretdutout");
if (enable_auth_req_cb) {
CU_ASSERT_TRUE(result);
/*automatically re-inititae the call*/ /*automatically re-inititae the call*/
linphone_core_add_auth_info(marie->lc,wrong_auth_info); linphone_core_add_auth_info(marie->lc,wrong_auth_info);
}
CU_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphoneCallError,1)); CU_ASSERT_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_LinphoneCallError,1));
if (enable_auth_req_cb) {
CU_ASSERT_EQUAL(marie->stat.number_of_auth_info_requested,2); CU_ASSERT_EQUAL(marie->stat.number_of_auth_info_requested,2);
}
/*to make sure unregister will work*/ /*to make sure unregister will work*/
linphone_core_clear_all_auth_info(marie->lc); linphone_core_clear_all_auth_info(marie->lc);
linphone_core_add_auth_info(marie->lc,good_auth_info); linphone_core_add_auth_info(marie->lc,good_auth_info);
linphone_core_manager_destroy(marie); linphone_core_manager_destroy(marie);
} }
static void call_rejected_because_wrong_credentials() { static void call_rejected_because_wrong_credentials() {
call_rejected_because_wrong_credentials_with_params(NULL); call_rejected_because_wrong_credentials_with_params(NULL,TRUE);
} }
static void call_rejected_without_403_because_wrong_credentials() { static void call_rejected_without_403_because_wrong_credentials() {
call_rejected_because_wrong_credentials_with_params("tester-no-403"); call_rejected_because_wrong_credentials_with_params("tester-no-403",TRUE);
}
static void call_rejected_without_403_because_wrong_credentials_no_auth_req_cb() {
call_rejected_because_wrong_credentials_with_params("tester-no-403",FALSE);
} }
#ifdef VIDEO_ENABLED #ifdef VIDEO_ENABLED
...@@ -1480,6 +1492,7 @@ test_t call_tests[] = { ...@@ -1480,6 +1492,7 @@ test_t call_tests[] = {
{ "Call with privacy", call_with_privacy }, { "Call with privacy", call_with_privacy },
{ "Call rejected because of wrong credential", call_rejected_because_wrong_credentials}, { "Call rejected because of wrong credential", call_rejected_because_wrong_credentials},
{ "Call rejected without 403 because of wrong credential", call_rejected_without_403_because_wrong_credentials}, { "Call rejected without 403 because of wrong credential", call_rejected_without_403_because_wrong_credentials},
{ "Call rejected without 403 because of wrong credential and no auth req cb", call_rejected_without_403_because_wrong_credentials_no_auth_req_cb},
{ "Simple conference", simple_conference }, { "Simple conference", simple_conference },
{ "Simple call transfer", simple_call_transfer }, { "Simple call transfer", simple_call_transfer },
{ "Unattended call transfer", unattended_call_transfer }, { "Unattended call transfer", unattended_call_transfer },
......
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