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

SRS5: Config: Support better env name for prefixed with srs (#3370)

* Actions: Fix github action warnings.

* Forward: Bind the context id of source or stream.

* Config: Support better env names.

PICK a4e7427433

Co-authored-by: pengfei.ma <pengfei.ma@ctechm.com>
Co-authored-by: Haibo Chen <495810242@qq.com>
This commit is contained in:
Winlin 2023-01-11 10:39:05 +08:00 committed by winlin
parent f46231cf3e
commit 498ce72af8
8 changed files with 53 additions and 13 deletions

View file

@ -3943,6 +3943,9 @@ VOID TEST(ConfigEnvTest, CheckEnvValuesGlobal)
SrsSetEnvConfig(pid, "SRS_PID", "xxx");
EXPECT_STREQ("xxx", conf.get_pid_file().c_str());
SrsSetEnvConfig(log_tank, "SRS_SRS_LOG_TANK", "console");
EXPECT_FALSE(conf.get_log_tank_file());
SrsSetEnvConfig(log_file, "SRS_SRS_LOG_FILE", "xxx2");
EXPECT_STREQ("xxx2", conf.get_log_file().c_str());
@ -3956,6 +3959,28 @@ VOID TEST(ConfigEnvTest, CheckEnvValuesGlobal)
EXPECT_STREQ("xxx5", conf.get_work_dir().c_str());
}
if (true) {
MockSrsConfig conf;
SrsSetEnvConfig(pid, "SRS_PID", "xxx");
EXPECT_STREQ("xxx", conf.get_pid_file().c_str());
SrsSetEnvConfig(log_tank, "SRS_LOG_TANK", "console");
EXPECT_FALSE(conf.get_log_tank_file());
SrsSetEnvConfig(log_file, "SRS_LOG_FILE", "xxx2");
EXPECT_STREQ("xxx2", conf.get_log_file().c_str());
SrsSetEnvConfig(log_level, "SRS_LOG_LEVEL", "xxx3");
EXPECT_STREQ("xxx3", conf.get_log_level().c_str());
SrsSetEnvConfig(log_level_v2, "SRS_LOG_LEVEL_V2", "xxx4");
EXPECT_STREQ("xxx4", conf.get_log_level_v2().c_str());
SrsSetEnvConfig(work_dir, "SRS_WORK_DIR", "xxx5");
EXPECT_STREQ("xxx5", conf.get_work_dir().c_str());
}
if (true) {
MockSrsConfig conf;