From 5f9400e0a9201527df063459f747b132622ba6ce Mon Sep 17 00:00:00 2001 From: Romain Leroux Date: Sat, 17 Feb 2024 22:41:27 +0100 Subject: [PATCH] Update libdatachannel to 0.20.1 --- Cargo.toml | 4 ++-- datachannel-sys/Cargo.toml | 4 ++-- datachannel-sys/libdatachannel | 2 +- src/datachannel.rs | 18 ++++++++---------- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b482875..d974bac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" @@ -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" diff --git a/datachannel-sys/Cargo.toml b/datachannel-sys/Cargo.toml index 917726c..eee967a 100644 --- a/datachannel-sys/Cargo.toml +++ b/datachannel-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "datachannel-sys" -version = "0.19.5" +version = "0.20.1" authors = ["Romain Leroux "] edition = "2021" links = "datachannel" @@ -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 } diff --git a/datachannel-sys/libdatachannel b/datachannel-sys/libdatachannel index 3cbfc42..7841d9f 160000 --- a/datachannel-sys/libdatachannel +++ b/datachannel-sys/libdatachannel @@ -1 +1 @@ -Subproject commit 3cbfc42a018a144224e3f9032c6635491ee8672d +Subproject commit 7841d9f34cf9bd735958ae203a2536c14240c8a5 diff --git a/src/datachannel.rs b/src/datachannel.rs index a85e629..a7e1b7c 100644 --- a/src/datachannel.rs +++ b/src/datachannel.rs @@ -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, } } @@ -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 } @@ -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, } } }