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

SRT: refine int to srs_utime_t in srt timeout config

This commit is contained in:
hondaxiao 2022-05-30 19:50:51 +08:00 committed by winlin
parent 26498a00fe
commit dd8ccfe5d8
3 changed files with 10 additions and 10 deletions

View file

@ -6880,8 +6880,8 @@ bool SrsConfig::get_srto_tlpktdrop() {
return SRS_CONF_PERFER_TRUE(conf->arg0());
}
int SrsConfig::get_srto_conntimeout() {
static int DEFAULT = 3000;
srs_utime_t SrsConfig::get_srto_conntimeout() {
static srs_utime_t DEFAULT = 3 * SRS_UTIME_SECONDS;
SrsConfDirective* conf = root->get("srt_server");
if (!conf) {
return DEFAULT;
@ -6891,11 +6891,11 @@ int SrsConfig::get_srto_conntimeout() {
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
return atoi(conf->arg0().c_str());
return (srs_utime_t)(::atoi(conf->arg0().c_str()) * SRS_UTIME_MILLISECONDS);
}
int SrsConfig::get_srto_peeridletimeout() {
static int DEFAULT = 10000;
srs_utime_t SrsConfig::get_srto_peeridletimeout() {
static srs_utime_t DEFAULT = 10 * SRS_UTIME_SECONDS;
SrsConfDirective* conf = root->get("srt_server");
if (!conf) {
return DEFAULT;
@ -6905,7 +6905,7 @@ int SrsConfig::get_srto_peeridletimeout() {
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
return atoi(conf->arg0().c_str());
return (srs_utime_t)(::atoi(conf->arg0().c_str()) * SRS_UTIME_MILLISECONDS);
}
int SrsConfig::get_srto_sendbuf() {