Skip to content

Commit

Permalink
修正
Browse files Browse the repository at this point in the history
  • Loading branch information
tnoho committed Sep 27, 2024
1 parent cbbd0d8 commit 081cece
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/sora/sora_signaling.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class SoraSignaling : public std::enable_shared_from_this<SoraSignaling>,
void SendOnSignalingMessage(SoraSignalingType type,
SoraSignalingDirection direction,
std::string message);
void SendOnWsClose(boost::beast::websocket::close_reason& reason);
void SendOnWsClose(const boost::beast::websocket::close_reason& reason);

webrtc::DataBuffer ConvertToDataBuffer(const std::string& label,
const std::string& input);
Expand Down
8 changes: 4 additions & 4 deletions src/sora_signaling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,10 +704,10 @@ void SoraSignaling::DoInternalDisconnect(
self->on_ws_close_ = [self, on_close](boost::system::error_code ec) {
boost::system::error_code tec;
self->closing_timeout_timer_.cancel(tec);
auto reason = self->ws_->reason();
self->SendOnWsClose(reason);
bool ec_error = ec != boost::beast::websocket::error::closed;
if (ec_error) {
auto reason = self->ws_->reason();
self->SendOnWsClose(reason);
on_close(false, SoraSignalingErrorCode::CLOSE_FAILED,
"Failed to close WebSocket: ec=" + ec.message() +
" wscode=" + std::to_string(reason.code) +
Expand Down Expand Up @@ -1360,9 +1360,9 @@ void SoraSignaling::SendOnSignalingMessage(SoraSignalingType type,
}

void SoraSignaling::SendOnWsClose(
boost::beast::websocket::close_reason& reason) {
const boost::beast::websocket::close_reason& reason) {
if (auto ob = config_.observer.lock(); ob) {
ob->OnWsClose(reason.code, std::string(reason.reason.c_str()));
ob->OnWsClose(reason.code, reason.reason.c_str());
}
}

Expand Down

0 comments on commit 081cece

Please sign in to comment.