1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-15 04:42:04 +00:00

Refine the default config file. (#2711). v4.0.208

This commit is contained in:
winlin 2021-12-23 18:34:40 +08:00
parent 3188c772b1
commit d32195993d
3 changed files with 11 additions and 11 deletions

View file

@ -8,6 +8,7 @@ The changelog for SRS.
## SRS 4.0 Changelog
* v4.0, 2021-12-23, For [#2711](https://github.com/ossrs/srs/issues/2711), Refine the default config file. (#2711). v4.0.208
* v4.0, 2021-12-20, Merge [#2784](https://github.com/ossrs/srs/pull/2784): RTC: Support payload name AV1X/AV1. (#2784)(#2760). v4.0.207
* v4.0, 2021-12-07, Merge [#2771](https://github.com/ossrs/srs/pull/2771): RTC: Fix memory leak when replace rtp packet in cache. (#2771). v4.0.205
* v4.0, 2021-12-06, Merge [#2766](https://github.com/ossrs/srs/pull/2766): RTC: Fix nack encode seqnum. (#2766). v4.0.204

View file

@ -1982,23 +1982,22 @@ srs_error_t SrsConfig::parse_options(int argc, char** argv)
srs_trace(_srs_version);
// Try config files as bellow:
// config_file Specified by user, like conf/srs.conf
// try_docker_config Guess by SRS, like conf/docker.conf
// try_fhs_config For FHS, try /etc/srs/srs.conf first, @see https://github.com/ossrs/srs/pull/2711
if (!srs_path_exists(config_file)) {
// User specified config(not empty), like user/docker.conf
// If user specified *docker.conf, try *srs.conf, like user/srs.conf
// Try the default srs config, defined as SRS_CONF_DEFAULT_COFNIG_FILE, like conf/srs.conf
// Try config for FHS, like /etc/srs/srs.conf @see https://github.com/ossrs/srs/pull/2711
if (true) {
vector<string> try_config_files;
if (!config_file.empty()) {
try_config_files.push_back(config_file);
if (srs_string_ends_with(config_file, "docker.conf")) {
try_config_files.push_back(srs_string_replace(config_file, "docker.conf", "srs.conf"));
}
}
if (srs_string_ends_with(config_file, "docker.conf")) {
try_config_files.push_back(srs_string_replace(config_file, "docker.conf", "srs.conf"));
}
try_config_files.push_back(SRS_CONF_DEFAULT_COFNIG_FILE);
if (srs_string_ends_with(SRS_CONF_DEFAULT_COFNIG_FILE, "docker.conf")) {
try_config_files.push_back(srs_string_replace(SRS_CONF_DEFAULT_COFNIG_FILE, "docker.conf", "srs.conf"));
}
try_config_files.push_back("/etc/srs/srs.conf");
// Match the first exists file.
string exists_config_file;
for (int i = 0; i < (int) try_config_files.size(); i++) {
string try_config_file = try_config_files.at(i);

View file

@ -9,6 +9,6 @@
#define VERSION_MAJOR 4
#define VERSION_MINOR 0
#define VERSION_REVISION 207
#define VERSION_REVISION 208
#endif