Skip to content

Commit

Permalink
Threads-Hybrid: Always response channel with error information
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Apr 26, 2021
1 parent 5074a4d commit 10edbb5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions trunk/src/app/srs_app_hybrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,11 @@ srs_error_t SrsHybridServer::on_thread_message(SrsThreadMessage* msg, SrsThreadP
}
}

// TODO: FIXME: Response error?
if (!adapter) {
// TODO: FIXME: Response with error information?
srs_error_t r0 = channel->responder()->write(msg, sizeof(SrsThreadMessage), NULL);
srs_freep(r0); // Always response it, ignore any error.

return err;
}

Expand All @@ -429,8 +432,11 @@ srs_error_t SrsHybridServer::on_thread_message(SrsThreadMessage* msg, SrsThreadP
err = adapter->rtc->create_session(s->req, s->remote_sdp, s->local_sdp, s->mock_eip,
s->publish, s->dtls, s->srtp, &s->session);

// TODO: FIXME: Response error?
if (err != srs_success) {
// TODO: FIXME: Response with error information?
srs_error_t r0 = channel->responder()->write(msg, sizeof(SrsThreadMessage), NULL);
srs_freep(r0); // Always response it, ignore any error.

return srs_error_wrap(err, "create session");
}

Expand All @@ -441,6 +447,10 @@ srs_error_t SrsHybridServer::on_thread_message(SrsThreadMessage* msg, SrsThreadP
if (err != srs_success) {
return srs_error_wrap(err, "response");
}
} else {
// TODO: FIXME: Response with error information?
srs_error_t r0 = channel->responder()->write(msg, sizeof(SrsThreadMessage), NULL);
srs_freep(r0); // Always response it, ignore any error.
}

return err;
Expand Down

0 comments on commit 10edbb5

Please sign in to comment.