mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
avoid 100 trying to reset op auth counters
This commit is contained in:
parent
3da4777e96
commit
5c7330b17f
4 changed files with 35 additions and 21 deletions
|
|
@ -22,7 +22,7 @@
|
|||
<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">
|
||||
<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="-g -Wall -Qunused-arguments" CXXFLAGS="-g"" 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="-g -Wall -Qunused-arguments" CXXFLAGS="-g"" 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.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"/>
|
||||
|
|
|
|||
|
|
@ -146,12 +146,13 @@ void sal_process_authentication(SalOp *op) {
|
|||
if (is_within_dialog) {
|
||||
belle_sip_object_unref(new_request);
|
||||
}
|
||||
if (op->auth_info) sal_auth_info_delete(op->auth_info);
|
||||
if (auth_list){
|
||||
auth_event=(belle_sip_auth_event_t*)(auth_list->data);
|
||||
op->auth_info=sal_auth_info_create(auth_event);
|
||||
belle_sip_list_free_with_data(auth_list,(void (*)(void*))belle_sip_auth_event_destroy);
|
||||
}
|
||||
}
|
||||
/*always store auth info, for case of wrong credential*/
|
||||
if (op->auth_info) sal_auth_info_delete(op->auth_info);
|
||||
if (auth_list){
|
||||
auth_event=(belle_sip_auth_event_t*)(auth_list->data);
|
||||
op->auth_info=sal_auth_info_create(auth_event);
|
||||
belle_sip_list_free_with_data(auth_list,(void (*)(void*))belle_sip_auth_event_destroy);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -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);
|
||||
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*/
|
||||
op->auth_requests=0;
|
||||
}
|
||||
|
|
|
|||
2
oRTP
2
oRTP
|
|
@ -1 +1 @@
|
|||
Subproject commit 38eccb648fa80274082fb1aa299edcd37004f1cf
|
||||
Subproject commit b03acc0a37ee64a12e9854e2ea4b781a9412240d
|
||||
|
|
@ -1410,41 +1410,53 @@ static void call_established_with_rejected_reinvite_with_error(void) {
|
|||
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");
|
||||
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);
|
||||
bool_t result=FALSE;
|
||||
linphone_auth_info_set_passwd(wrong_auth_info,"passecretdutout");
|
||||
linphone_core_clear_all_auth_info(marie->lc);
|
||||
|
||||
if (user_agent) {
|
||||
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_TRUE(wait_for(marie->lc,marie->lc,&marie->stat.number_of_auth_info_requested,1));
|
||||
|
||||
linphone_auth_info_set_passwd(wrong_auth_info,"passecretdutout");
|
||||
|
||||
/*automatically re-inititae the call*/
|
||||
linphone_core_add_auth_info(marie->lc,wrong_auth_info);
|
||||
result=wait_for(marie->lc,marie->lc,&marie->stat.number_of_auth_info_requested,1);
|
||||
|
||||
if (enable_auth_req_cb) {
|
||||
CU_ASSERT_TRUE(result);
|
||||
/*automatically re-inititae the call*/
|
||||
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_EQUAL(marie->stat.number_of_auth_info_requested,2);
|
||||
|
||||
if (enable_auth_req_cb) {
|
||||
CU_ASSERT_EQUAL(marie->stat.number_of_auth_info_requested,2);
|
||||
}
|
||||
/*to make sure unregister will work*/
|
||||
linphone_core_clear_all_auth_info(marie->lc);
|
||||
linphone_core_add_auth_info(marie->lc,good_auth_info);
|
||||
|
||||
linphone_core_manager_destroy(marie);
|
||||
}
|
||||
|
||||
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() {
|
||||
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
|
||||
|
|
@ -1480,6 +1492,7 @@ test_t call_tests[] = {
|
|||
{ "Call with privacy", call_with_privacy },
|
||||
{ "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 and no auth req cb", call_rejected_without_403_because_wrong_credentials_no_auth_req_cb},
|
||||
{ "Simple conference", simple_conference },
|
||||
{ "Simple call transfer", simple_call_transfer },
|
||||
{ "Unattended call transfer", unattended_call_transfer },
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue