Skip to content

Commit

Permalink
SRT: Fix the missing config mss.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Oct 8, 2023
1 parent 411ae5a commit 627c035
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions trunk/conf/full.conf
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,12 @@ srt_server {
# Overwrite by env SRS_SRT_SERVER_MAXBW
# default: -1
maxbw 1000000000;
# Maximum Segment Size. Used for buffer allocation and rate calculation using packet counter assuming fully
# filled packets. Each party can set its own MSS value independently. During a handshake the parties exchange
# MSS values, and the lowest is used.
# Overwrite by env SRS_SRT_SERVER_MSS
# default: 1500
mss 1500;
# The timeout time of the SRT connection on the sender side in ms. When SRT connects to a peer costs time
# more than this config, it will be close.
# Overwrite by env SRS_SRT_SERVER_CONNECT_TIMEOUT
Expand Down
4 changes: 2 additions & 2 deletions trunk/src/app/srs_app_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7912,15 +7912,15 @@ int64_t SrsConfig::get_srto_maxbw()

int SrsConfig::get_srto_mss()
{
SRS_OVERWRITE_BY_ENV_INT("srs.srt_server.mms"); // SRS_SRT_SERVER_MMS
SRS_OVERWRITE_BY_ENV_INT("srs.srt_server.mss"); // SRS_SRT_SERVER_MSS

static int DEFAULT = 1500;
SrsConfDirective* conf = root->get("srt_server");
if (!conf) {
return DEFAULT;
}

conf = conf->get("mms");
conf = conf->get("mss");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/utest/srs_utest_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4225,7 +4225,7 @@ VOID TEST(ConfigEnvTest, CheckEnvValuesSrtServer)
SrsSetEnvConfig(srto_maxbw, "SRS_SRT_SERVER_MAXBW", "1000000000");
EXPECT_EQ(1000000000, conf.get_srto_maxbw());

SrsSetEnvConfig(srto_mss, "SRS_SRT_SERVER_MMS", "1000");
SrsSetEnvConfig(srto_mss, "SRS_SRT_SERVER_MSS", "1000");
EXPECT_EQ(1000, conf.get_srto_mss());

SrsSetEnvConfig(srto_conntimeout, "SRS_SRT_SERVER_CONNECT_TIMEOUT", "2000");
Expand Down

0 comments on commit 627c035

Please sign in to comment.