Skip to content

Commit

Permalink
Update libdatachannel to 0.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lerouxrgd committed Feb 17, 2024
1 parent b214324 commit 5f9400e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "datachannel"
version = "0.11.3"
version = "0.12.0"
edition = "2021"
description = "Rust wrappers for libdatachannel."
repository = "https://github.com/lerouxrgd/datachannel-rs"
Expand All @@ -10,7 +10,7 @@ license = "MPL-2.0"
readme = "README.md"

[dependencies]
datachannel-sys = { path = "datachannel-sys", version = "0.19.4" }
datachannel-sys = { path = "datachannel-sys", version = "0.20.1" }
derivative = "2"
log = { version = "0.4", optional = true }
parking_lot = "0.12"
Expand Down
4 changes: 2 additions & 2 deletions datachannel-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "datachannel-sys"
version = "0.19.5"
version = "0.20.1"
authors = ["Romain Leroux <[email protected]>"]
edition = "2021"
links = "datachannel"
Expand All @@ -16,7 +16,7 @@ exclude = [
]

[build-dependencies]
bindgen = "0.65"
bindgen = "0.69"
cmake = "0.1"
cpp_build = { version = "0.5", optional = true }
once_cell = { version = "1", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion datachannel-sys/libdatachannel
Submodule libdatachannel updated 107 files
18 changes: 8 additions & 10 deletions src/datachannel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,17 @@ use crate::logger;
pub struct Reliability {
pub unordered: bool,
pub unreliable: bool,
pub max_packet_life_time: u16,
pub max_retransmits: u16,
pub max_packet_life_time: u32,
pub max_retransmits: u32,
}

impl Reliability {
fn from_raw(raw: sys::rtcReliability) -> Self {
let max_packet_life_time = u16::try_from(raw.maxPacketLifeTime).unwrap_or(0);
let max_retransmits = u16::try_from(raw.maxPacketLifeTime).unwrap_or(0);
Self {
unordered: raw.unordered,
unreliable: raw.unreliable,
max_packet_life_time,
max_retransmits,
max_packet_life_time: raw.maxPacketLifeTime,
max_retransmits: raw.maxRetransmits,
}
}

Expand All @@ -39,12 +37,12 @@ impl Reliability {
self
}

pub fn max_packet_life_time(mut self, max_packet_life_time: u16) -> Self {
pub fn max_packet_life_time(mut self, max_packet_life_time: u32) -> Self {
self.max_packet_life_time = max_packet_life_time;
self
}

pub fn max_retransmits(mut self, max_retransmits: u16) -> Self {
pub fn max_retransmits(mut self, max_retransmits: u32) -> Self {
self.max_retransmits = max_retransmits;
self
}
Expand All @@ -53,8 +51,8 @@ impl Reliability {
sys::rtcReliability {
unordered: self.unordered,
unreliable: self.unreliable,
maxPacketLifeTime: self.max_packet_life_time as i32,
maxRetransmits: self.max_retransmits as i32,
maxPacketLifeTime: self.max_packet_life_time,
maxRetransmits: self.max_retransmits,
}
}
}
Expand Down

0 comments on commit 5f9400e

Please sign in to comment.