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

For #1579, support gracefully quit. 3.0.119

This commit is contained in:
winlin 2020-02-18 19:59:47 +08:00
parent e6c329293c
commit 3c597545b1
10 changed files with 120 additions and 17 deletions

View file

@ -3487,7 +3487,7 @@ srs_error_t SrsConfig::check_normal_config()
&& n != "http_api" && n != "stats" && n != "vhost" && n != "pithy_print_ms"
&& n != "http_server" && n != "stream_caster"
&& n != "utc_time" && n != "work_dir" && n != "asprocess"
&& n != "ff_log_level"
&& n != "ff_log_level" && n != "grace_final_wait"
) {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal directive %s", n.c_str());
}
@ -4050,6 +4050,18 @@ bool SrsConfig::get_asprocess()
return SRS_CONF_PERFER_FALSE(conf->arg0());
}
srs_utime_t SrsConfig::get_grace_final_wait()
{
static srs_utime_t DEFAULT = 3200 * SRS_UTIME_MILLISECONDS;
SrsConfDirective* conf = root->get("grace_final_wait");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
return (srs_utime_t)(::atol(conf->arg0().c_str()) * SRS_UTIME_MILLISECONDS);
}
vector<SrsConfDirective*> SrsConfig::get_stream_casters()
{
srs_assert(root);