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:
parent
6c55fd3e4b
commit
c1e07d6a96
8 changed files with 47 additions and 38 deletions
|
@ -234,15 +234,17 @@ srs_error_t SrsEdgeIngester::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, "edge ingester");
|
||||
}
|
||||
|
||||
if ((err = do_cycle()) != srs_success) {
|
||||
srs_warn("EdgeIngester: Ignore error, %s", srs_error_desc(err).c_str());
|
||||
srs_freep(err);
|
||||
}
|
||||
|
||||
if ((err = trd->pull()) != srs_success) {
|
||||
return srs_error_wrap(err, "edge ingester");
|
||||
}
|
||||
|
||||
|
||||
srs_usleep(SRS_EDGE_INGESTER_CIMS);
|
||||
}
|
||||
|
||||
|
@ -314,7 +316,6 @@ srs_error_t SrsEdgeIngester::ingest(string& redirect)
|
|||
redirect = "";
|
||||
|
||||
while (true) {
|
||||
srs_error_t err = srs_success;
|
||||
if ((err = trd->pull()) != srs_success) {
|
||||
return srs_error_wrap(err, "thread quit");
|
||||
}
|
||||
|
@ -534,14 +535,16 @@ srs_error_t SrsEdgeForwarder::cycle()
|
|||
srs_error_t err = srs_success;
|
||||
|
||||
while (true) {
|
||||
if ((err = do_cycle()) != srs_success) {
|
||||
return srs_error_wrap(err, "do cycle");
|
||||
}
|
||||
|
||||
// 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, "thread pull");
|
||||
}
|
||||
|
||||
|
||||
if ((err = do_cycle()) != srs_success) {
|
||||
return srs_error_wrap(err, "do cycle");
|
||||
}
|
||||
|
||||
srs_usleep(SRS_EDGE_FORWARDER_CIMS);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue