Merge branch 'config_credential_fix' of https://github.com/skystar-p/coturn into skystar-p-config_credential_fix
This commit is contained in:
commit
aaac85355d
@ -39,6 +39,8 @@
|
||||
|
||||
static int use_lt_credentials = 0;
|
||||
static int anon_credentials = 0;
|
||||
static int use_lt_credentials_only = 0;
|
||||
static int timestamp_credentials = 0;
|
||||
|
||||
////// ALPN //////////
|
||||
|
||||
@ -1162,6 +1164,7 @@ static void set_option(int c, char *value)
|
||||
if (get_bool_value(value)) {
|
||||
turn_params.ct = TURN_CREDENTIALS_LONG_TERM;
|
||||
use_lt_credentials=1;
|
||||
use_lt_credentials_only=1;
|
||||
} else {
|
||||
turn_params.ct = TURN_CREDENTIALS_UNDEFINED;
|
||||
use_lt_credentials=0;
|
||||
@ -1223,12 +1226,14 @@ static void set_option(int c, char *value)
|
||||
#endif
|
||||
case AUTH_SECRET_OPT:
|
||||
turn_params.use_auth_secret_with_timestamp = 1;
|
||||
timestamp_credentials = 1;
|
||||
turn_params.ct = TURN_CREDENTIALS_LONG_TERM;
|
||||
use_lt_credentials = 1;
|
||||
break;
|
||||
case STATIC_AUTH_SECRET_VAL_OPT:
|
||||
add_to_secrets_list(&turn_params.default_users_db.ram_db.static_auth_secrets,value);
|
||||
turn_params.use_auth_secret_with_timestamp = 1;
|
||||
timestamp_credentials = 1;
|
||||
turn_params.ct = TURN_CREDENTIALS_LONG_TERM;
|
||||
use_lt_credentials = 1;
|
||||
break;
|
||||
@ -1989,6 +1994,10 @@ int main(int argc, char **argv)
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if(use_lt_credentials_only && timestamp_credentials) {
|
||||
TURN_LOG_FUNC(TURN_LOG_LEVEL_ERROR, "\nCONFIGURATION ALERT: you specified --lt-cred-mech and --use-auth-secret both. Check your configuration.\n");
|
||||
}
|
||||
|
||||
if(!use_lt_credentials && !anon_credentials) {
|
||||
if(turn_params.default_users_db.ram_db.users_number) {
|
||||
TURN_LOG_FUNC(TURN_LOG_LEVEL_WARNING, "\nCONFIGURATION ALERT: you specified long-term user accounts, (-u option) \n but you did not specify the long-term credentials option\n (-a or --lt-cred-mech option).\n I am turning --lt-cred-mech ON for you, but double-check your configuration.\n");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user