Skip to content

Commit

Permalink
Merge branch 'release/2023.5.1' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
melpon committed May 16, 2023
2 parents 2885285 + 05f632c commit f7f74f7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@

## develop

## 2023.5.1 (2023-05-16)

- [FIX] ソケット切断時にクラッシュすることがあるのを修正
- @melpon

## 2023.5.0 (2023-05-08)

- [UPDATE] WebRTC を m114.5735.0.1 に上げる
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SORA_CPP_SDK_VERSION=2023.5.0
SORA_CPP_SDK_VERSION=2023.5.1
WEBRTC_BUILD_VERSION=m114.5735.0.1
BOOST_VERSION=1.82.0
CMAKE_VERSION=3.25.3
Expand Down
17 changes: 11 additions & 6 deletions src/sora_signaling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ void SoraSignaling::OnRedirect(boost::system::error_code ec,
return;
}

connection_timeout_timer_.cancel();
boost::system::error_code tec;
connection_timeout_timer_.cancel(tec);

state_ = State::Connected;
ws_ = ws;
Expand Down Expand Up @@ -642,7 +643,8 @@ void SoraSignaling::DoInternalDisconnect(
});
self->on_ws_close_ = [self, ec1,
on_close](boost::system::error_code ec2) {
self->closing_timeout_timer_.cancel();
boost::system::error_code tec;
self->closing_timeout_timer_.cancel(tec);
auto ws_reason = self->ws_->reason();
std::string ws_reason_str =
" wscode=" + std::to_string(ws_reason.code) +
Expand Down Expand Up @@ -714,7 +716,8 @@ void SoraSignaling::DoInternalDisconnect(
self->ws_->Cancel();
});
self->on_ws_close_ = [self, on_close](boost::system::error_code ec) {
self->closing_timeout_timer_.cancel();
boost::system::error_code tec;
self->closing_timeout_timer_.cancel(tec);
bool ec_error = ec != boost::beast::websocket::error::closed;
if (ec_error) {
auto reason = self->ws_->reason();
Expand Down Expand Up @@ -785,7 +788,8 @@ void SoraSignaling::OnConnect(boost::system::error_code ec,
return;
}

connection_timeout_timer_.cancel();
boost::system::error_code tec;
connection_timeout_timer_.cancel(tec);

RTC_LOG(LS_INFO) << "Signaling Websocket is connected: url=" << url;
state_ = State::Connected;
Expand Down Expand Up @@ -1359,8 +1363,9 @@ bool SoraSignaling::SendDataChannel(const std::string& label,
}

void SoraSignaling::Clear() {
connection_timeout_timer_.cancel();
closing_timeout_timer_.cancel();
boost::system::error_code tec;
connection_timeout_timer_.cancel(tec);
closing_timeout_timer_.cancel(tec);
connecting_wss_.clear();
connected_signaling_url_.clear();
pc_ = nullptr;
Expand Down
8 changes: 5 additions & 3 deletions src/websocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,15 +522,17 @@ void Websocket::OnClose(close_callback_t on_close,
RTC_LOG(LS_INFO) << "Websocket::OnClose this=" << (void*)this
<< " ec=" << ec.message() << " code=" << reason().code
<< " reason=" << reason().reason;
close_timeout_timer_.cancel();
boost::system::error_code tec;
close_timeout_timer_.cancel(tec);
on_close(ec);
}

void Websocket::Cancel() {
boost::system::error_code ec;
if (IsSSL()) {
wss_->next_layer().next_layer().cancel();
wss_->next_layer().next_layer().cancel(ec);
} else {
ws_->next_layer().cancel();
ws_->next_layer().cancel(ec);
}
}

Expand Down

0 comments on commit f7f74f7

Please sign in to comment.