From be0769ce994832f15497475e83c1e662621ab316 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Wed, 2 Sep 2026 15:00:20 +0800 Subject: [PATCH] webrtc: take the fork's loss recovery for sending without a congestion window rustdesk-org/webrtc 825a0a48: without a congestion window a chunk is lost once three chunks sent after its latest transmission are acked, counted in send order so retransmitted chunks are covered too, and the fast retransmit sends every lost chunk at once, as KCP nc=1 does; before, a lost retransmission waited for T3-rtx. Also fixes the delayed SACK timer never re-arming, the switch applying to established associations, T3-rtx resending one chunk when the peer's window is full, and bounds new data to 1 MiB / 1024 chunks in flight like KCP's snd_wnd. Simulated 35ms one-way, random loss both ways, 30 fps, frames later than 200ms out of 1200: 12 KB at 5% loss 996 -> 55 (KCP 61); 40 KB at 2% loss 1183 -> 20 (KCP 39). Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_019aokqJuhjvB3kijXtAg5Ns --- Cargo.lock | 4 ++-- Cargo.toml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 761d008a6..b5c53e35c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9706,7 +9706,7 @@ dependencies = [ [[package]] name = "webrtc-sctp" version = "0.12.0" -source = "git+https://github.com/rustdesk-org/webrtc?rev=65fbe090326bf3abe8480d159b6bb07b5f509c22#65fbe090326bf3abe8480d159b6bb07b5f509c22" +source = "git+https://github.com/rustdesk-org/webrtc?rev=825a0a4862818f74406d8e1cc25be72259228235#825a0a4862818f74406d8e1cc25be72259228235" dependencies = [ "arc-swap", "async-trait", @@ -9746,7 +9746,7 @@ dependencies = [ [[package]] name = "webrtc-util" version = "0.11.0" -source = "git+https://github.com/rustdesk-org/webrtc?rev=65fbe090326bf3abe8480d159b6bb07b5f509c22#65fbe090326bf3abe8480d159b6bb07b5f509c22" +source = "git+https://github.com/rustdesk-org/webrtc?rev=825a0a4862818f74406d8e1cc25be72259228235#825a0a4862818f74406d8e1cc25be72259228235" dependencies = [ "async-trait", "bitflags 1.3.2", diff --git a/Cargo.toml b/Cargo.toml index a42d219fd..3a78502be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -223,8 +223,8 @@ libxdo-sys = { path = "libs/libxdo-sys-stub" } # IPv6; and its AIMD pins a lossy long-haul link to MSS/(RTT*sqrt(p)), so a switch sends without # a congestion window, as KCP does - on by default, `allow-webrtc-congestion-control` opts back in. # Pinned by rev, not branch: a fork branch can be rewritten out from under the lockfile. -webrtc-util = { git = "https://github.com/rustdesk-org/webrtc", rev = "65fbe090326bf3abe8480d159b6bb07b5f509c22" } -webrtc-sctp = { git = "https://github.com/rustdesk-org/webrtc", rev = "65fbe090326bf3abe8480d159b6bb07b5f509c22" } +webrtc-util = { git = "https://github.com/rustdesk-org/webrtc", rev = "825a0a4862818f74406d8e1cc25be72259228235" } +webrtc-sctp = { git = "https://github.com/rustdesk-org/webrtc", rev = "825a0a4862818f74406d8e1cc25be72259228235" } [package.metadata.winres] LegalCopyright = "Copyright © 2026 Purslane Tech Pte. Ltd. All rights reserved."