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

For #1634, always check status in thread loop. 3.0.126

This commit is contained in:
winlin 2020-03-12 08:59:13 +08:00
parent 6c55fd3e4b
commit c1e07d6a96
8 changed files with 47 additions and 38 deletions

View file

@ -181,15 +181,17 @@ srs_error_t SrsForwarder::cycle()
srs_error_t err = srs_success;
while (true) {
// We always check status first.
// @see https://github.com/ossrs/srs/issues/1634#issuecomment-597571561
if ((err = trd->pull()) != srs_success) {
return srs_error_wrap(err, "forwarder");
}
if ((err = do_cycle()) != srs_success) {
srs_warn("Forwarder: Ignore error, %s", srs_error_desc(err).c_str());
srs_freep(err);
}
if ((err = trd->pull()) != srs_success) {
return srs_error_wrap(err, "forwarder");
}
srs_usleep(SRS_FORWARDER_CIMS);
}