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

Forward: when unpublish crash caused by uninitialized forward connection. v6.0.107 (#3914)

Description
A crash occurs when a forward relay connection has not been established
and an unpublish event is triggered simultaneously. For instance, if DVR
and forward are configured with a specified DVR path that already
exists, initiating a stream will trigger a crash.

Objective
Fix the crash caused by the forward mechanism.

Additional Information
For detailed reproduction steps, please refer to issue #3901.

---------

Co-authored-by: john <hondaxiao@tencent.com>
This commit is contained in:
chundonglinlin 2023-12-30 09:05:55 +08:00 committed by GitHub
parent 360aaaf9e4
commit 804ef3f98c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View file

@ -94,7 +94,7 @@ srs_error_t SrsForwarder::on_publish()
void SrsForwarder::on_unpublish()
{
trd->stop();
sdk->close();
if (sdk) sdk->close();
}
srs_error_t SrsForwarder::on_meta_data(SrsSharedPtrMessage* shared_metadata)