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

Squash: Fix bugs. v5.0.20

This commit is contained in:
winlin 2022-01-11 08:40:05 +08:00
parent d2fe83b032
commit 4110fb14cb
36 changed files with 433 additions and 98 deletions

View file

@ -2471,7 +2471,7 @@ srs_error_t SrsConfig::check_normal_config()
&& 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 != "query_latest_version"
&& n != "circuit_breaker" && n != "is_full"
&& n != "circuit_breaker" && n != "is_full" && n != "in_docker"
) {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal directive %s", n.c_str());
}
@ -2542,7 +2542,7 @@ srs_error_t SrsConfig::check_normal_config()
string n = conf->at(i)->name;
if (n != "enabled" && n != "listen" && n != "dir" && n != "candidate" && n != "ecdsa"
&& n != "encrypt" && n != "reuseport" && n != "merge_nalus" && n != "black_hole"
&& n != "ip_family") {
&& n != "ip_family" && n != "api_as_candidates") {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal rtc_server.%s", n.c_str());
}
}
@ -2999,6 +2999,18 @@ bool SrsConfig::get_daemon()
return SRS_CONF_PERFER_TRUE(conf->arg0());
}
bool SrsConfig::get_in_docker()
{
static bool DEFAULT = false;
SrsConfDirective* conf = root->get("in_docker");
if (!conf) {
return DEFAULT;
}
return SRS_CONF_PERFER_FALSE(conf->arg0());
}
bool SrsConfig::is_full_config()
{
static bool DEFAULT = false;
@ -3532,6 +3544,23 @@ std::string SrsConfig::get_rtc_server_candidates()
return conf->arg0();
}
bool SrsConfig::get_api_as_candidates()
{
static bool DEFAULT = true;
SrsConfDirective* conf = root->get("rtc_server");
if (!conf) {
return DEFAULT;
}
conf = conf->get("api_as_candidates");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
return SRS_CONF_PERFER_TRUE(conf->arg0());
}
std::string SrsConfig::get_rtc_server_ip_family()
{
static string DEFAULT = "ipv4";