Skip to content

Commit

Permalink
Refine the default config file. (#2711). v4.0.208
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Dec 23, 2021
1 parent 3188c77 commit d321959
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions trunk/doc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 9 additions & 10 deletions trunk/src/app/srs_app_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
}
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"));
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);
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);
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/core/srs_core_version4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

#define VERSION_MAJOR 4
#define VERSION_MINOR 0
#define VERSION_REVISION 207
#define VERSION_REVISION 208

#endif

0 comments on commit d321959

Please # to comment.