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

Merge SRS3

This commit is contained in:
winlin 2020-03-11 19:45:01 +08:00
commit 6a765ab849
8 changed files with 63 additions and 11 deletions

View file

@ -557,9 +557,11 @@ void SrsServer::gracefully_dispose()
close_listeners(SrsListenerMpegTsOverUdp);
close_listeners(SrsListenerRtsp);
close_listeners(SrsListenerFlv);
srs_trace("listeners closed");
// Fast stop to notify FFMPEG to quit, wait for a while then fast kill.
ingester->stop();
srs_trace("ingesters stopped");
// Wait for connections to quit.
// While gracefully quiting, user can requires SRS to fast quit.
@ -575,6 +577,7 @@ void SrsServer::gracefully_dispose()
// dispose the source for hls and dvr.
_srs_sources->dispose();
srs_trace("source disposed");
#ifdef SRS_AUTO_MEM_WATCH
srs_memory_report();
@ -887,6 +890,7 @@ srs_error_t SrsServer::cycle()
void SrsServer::on_signal(int signo)
{
if (signo == SRS_SIGNAL_RELOAD) {
srs_trace("reload config, signo=%d", signo);
signal_reload = true;
return;
}
@ -894,7 +898,7 @@ void SrsServer::on_signal(int signo)
#ifndef SRS_AUTO_GPERF_MC
if (signo == SRS_SIGNAL_REOPEN_LOG) {
_srs_log->reopen();
srs_warn("reopen log file");
srs_warn("reopen log file, signo=%d", signo);
return;
}
#endif
@ -902,7 +906,7 @@ void SrsServer::on_signal(int signo)
#ifdef SRS_AUTO_GPERF_MC
if (signo == SRS_SIGNAL_REOPEN_LOG) {
signal_gmc_stop = true;
srs_warn("for gmc, the SIGUSR1 used as SIGINT");
srs_warn("for gmc, the SIGUSR1 used as SIGINT, signo=%d", signo);
return;
}
#endif
@ -914,7 +918,7 @@ void SrsServer::on_signal(int signo)
if (signo == SIGINT) {
#ifdef SRS_AUTO_GPERF_MC
srs_trace("gmc is on, main cycle will terminate normally.");
srs_trace("gmc is on, main cycle will terminate normally, signo=%d", signo);
signal_gmc_stop = true;
#else
#ifdef SRS_AUTO_MEM_WATCH