1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

System: Fail if use use full.conf

This commit is contained in:
winlin 2021-05-18 11:02:57 +08:00
parent 1bd6bfd142
commit 0d14c4b073
3 changed files with 33 additions and 3 deletions

View file

@ -3593,6 +3593,12 @@ srs_error_t SrsConfig::check_config()
if ((err = check_number_connections()) != srs_success) {
return srs_error_wrap(err, "check connections");
}
// If use the full.conf, fail.
if (is_full_config()) {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID,
"never use full.conf(%s)", config_file.c_str());
}
return err;
}
@ -3625,7 +3631,7 @@ srs_error_t SrsConfig::check_normal_config()
&& n != "ff_log_level" && n != "grace_final_wait" && n != "force_grace_quit"
&& n != "grace_start_wait" && n != "empty_ip_ok" && n != "disable_daemon_for_docker"
&& n != "inotify_auto_reload" && n != "auto_reload_for_docker" && n != "tcmalloc_release_rate"
&& n != "circuit_breaker"
&& n != "circuit_breaker" && n != "is_full"
) {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal directive %s", n.c_str());
}
@ -4146,6 +4152,18 @@ bool SrsConfig::get_daemon()
return SRS_CONF_PERFER_TRUE(conf->arg0());
}
bool SrsConfig::is_full_config()
{
static bool DEFAULT = false;
SrsConfDirective* conf = root->get("is_full");
if (!conf) {
return DEFAULT;
}
return SRS_CONF_PERFER_FALSE(conf->arg0());
}
SrsConfDirective* SrsConfig::get_root()
{
return root;