Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ dtls = { package = "webrtc-dtls", version = "0.5.2" }
rtp = "0.6.5"
rtcp = "0.6.5"
srtp = { package = "webrtc-srtp", version = "0.8.9" }
sctp = { package = "webrtc-sctp", version = "0.4.3" }
data = { package = "webrtc-data", version = "0.3.3" }
sctp = { package = "webrtc-sctp", version = "0.5.0" }
data = { package = "webrtc-data", version = "0.4.0" }
media = { package = "webrtc-media", version = "0.4.5" }
interceptor = "0.7.6"
tokio = { version = "1.19", features = ["full"] }
Expand Down
10 changes: 10 additions & 0 deletions src/sctp_transport/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,22 @@ impl RTCSctpTransport {
}

async fn accept_data_channels(param: AcceptDataChannelParams) {
let dcs = param.data_channels.lock().await;
let mut existing_data_channels = Vec::new();
for dc in dcs.iter() {
if let Some(dc) = dc.data_channel.lock().await.clone() {
existing_data_channels.push(dc);
}
}
drop(dcs);

loop {
let dc = tokio::select! {
_ = param.notify_rx.notified() => break,
result = DataChannel::accept(
&param.sctp_association,
data::data_channel::Config::default(),
&existing_data_channels,
) => {
match result {
Ok(dc) => dc,
Expand Down