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

Squash: Merge SRS 4.0

This commit is contained in:
winlin 2021-10-12 14:04:02 +08:00
parent 93cd025e2a
commit 4e6a3321cd
5 changed files with 14 additions and 2 deletions

View file

@ -1984,6 +1984,16 @@ srs_error_t SrsConfig::parse_options(int argc, char** argv)
if (config_file.empty()) {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "no config, read help: %s -h", argv[0]);
}
// For docker, if config is not specified, try srs.conf instead.
string try_config = srs_string_replace(config_file, "docker.conf", "srs.conf");
if (!srs_path_exists(config_file) && try_config != config_file) {
if (!srs_path_exists(try_config)) {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "no config file %s or %s", config_file.c_str(), try_config.c_str());
}
srs_warn("user config %s does not exists, use %s instead", config_file.c_str(), try_config.c_str());
config_file = try_config;
}
err = parse_file(config_file.c_str());