Repository navigation
fix(tcp): open the receive window when the read buffer is smaller than the MTU - #5
Merged
Merged
Conversation
…n the MTU Silly-window avoidance advertised a zero window until a full MTU of space was free. With an MTU above TcpConfig::read_buffer_size (e.g. 32768 against the default 16384) that never happens, so even the SYN-ACK of an empty connection carried a zero window and normal data never flowed. Bound the threshold by half the read buffer, as RFC 1122 4.2.3.3 does; with the default MTU 1500 and 16 KiB buffer the threshold, and the behaviour, are unchanged. Raised in review of #4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
acking-you
added a commit
to acking-you/proxy-everything
that referenced
this pull request
Oct 27, 2026
- deps/ipstack: acking-you/ipstack#5, receive window opens when the read buffer is smaller than the MTU. - deps/better_mimalloc_rs: acking-you/better_mimalloc_rs#2, vendored mimalloc exports mi_malloc_size and mi_malloc_usable_size without the override (upstream f46cacf6). - deps/kanal: acking-you/kanal#2 and #3, kanal-plus 0.2.2 with batch receives and sends sound when a waker panics. Each is the commit merged on the fork's default branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
acking-you
added a commit
to acking-you/proxy-everything
that referenced
this pull request
Oct 27, 2026
* build: upgrade the toolchain, dependencies and every submodule Toolchain - nightly-2026-01-26 -> nightly-2026-10-26 (rust-toolchain.toml and both CI workflows). rustfmt.toml needs nightly; the newer compiler also unblocks sysinfo 0.39 (cfg_select). - CI: docker/login-action v4.7.0, Windows fvm 4.1.0 -> 4.3.2. crates.io - sysinfo 0.38 -> 0.39, arc-swap 1.9.3, rustls 0.23.46, plist 1.10, plus a lockfile refresh (tokio 1.54.1, ureq 3.5, uuid 1.29, icu 2.4, ...). - lru dropped: nothing in the workspace uses it. proxy-core also drops ureq, kanal and async-broadcast, which only proxy-client/server use; anyhow is a Windows-only dependency of proxy-updater. Cargo's new unused_dependencies lint flagged all of these. - Held: libc =0.2.189 and with it parking_lot 0.12 (0.13 needs libc 0.2.191). nix 0.31.3 still fails on iOS against newer libc; the fix (nix#2821) is unreleased. - New lints: AtomicX::fetch_update -> try_update, as_chunks for fixed-size chunks, saturating_sub in proxy-tui's Up handling. Submodules - tun2proxy: upstream v0.8.6 merged; ArgProxy -> ProxyParameters. - ipstack: upstream main merged. - kanal: kanal-plus 0.2.1 (upstream main merged, branches 0.5). The parent now uses it as kanal-plus and patches crates.io kanal-plus to the same checkout, so uni-stream no longer pulls a second copy whose branches 0.3 no longer compiles on current nightlies. - uni-stream: dependencies upgraded, parking_lot replaced by std's RwLock. - rust-smallvec: upstream v2 (2.0.0-beta.3) merged; smallvec! is deprecated, so the header buffer is built with new + resize. It is now its own Cargo workspace, so it and better_mimalloc_rs join the exclude list like every other fork (both were implicit members until now). - better_mimalloc_rs: mimalloc_rust 0.1.52 merged, vendored mimalloc v2.5.2. - sysproxy-rs: macOS fixes landed on a branch, unmaintained interfaces crate replaced by nix's getifaddrs. - ui/flutter: Flutter 3.47.8, latest pub dependencies, tray on tray_manager's native API. quinn stays at quinn-proto 0.11.19 / quinn 0.11.12, its latest release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(windows): use as_chunks_mut for the icon's BGRA swap The new nightly's clippy (chunks_exact_to_as_chunks) rejects constant-size chunks_exact_mut under -D warnings. This Windows-only call site was not compiled on the platforms checked locally. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(packet-tunnel): bind the loopback proxy before building Args Same shape as tun.rs; the inline form left rustfmt unable to lay out the map_err closure after the ProxyParameters rename. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * build: pin forks to their merged review fixes - deps/ipstack: acking-you/ipstack#5, receive window opens when the read buffer is smaller than the MTU. - deps/better_mimalloc_rs: acking-you/better_mimalloc_rs#2, vendored mimalloc exports mi_malloc_size and mi_malloc_usable_size without the override (upstream f46cacf6). - deps/kanal: acking-you/kanal#2 and #3, kanal-plus 0.2.2 with batch receives and sends sound when a waker panics. Each is the commit merged on the fork's default branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * build: pin the UI to its merged dependency upgrade Proxy-UI/Proxy-UI-Flutter#39 (merge 7cd9408): Flutter 3.47.8, latest pub dependencies, and the tray moved to tray_manager's native API with the menu opened from Dart so it is never replaced or freed while on screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the P2 review finding on #4 (
src/stream/tcp.rs): silly-window avoidance advertised a zero window until a full MTU of receive space was free. With an MTU aboveTcpConfig::read_buffer_size(e.g. 32768 against the default 16384) that can never happen, so even the SYN-ACK of an empty connection carried a zero window and data never flowed. The rule came from upstream (narrowlink#95/narrowlink#99 window work).The threshold is now
min(MTU, read_buffer_size / 2), the bound RFC 1122 §4.2.3.3 gives, computed byTcb::get_recv_window_threshold, and the comparison uses the unclamped free space. With the default MTU 1500 and 16 KiB buffer the threshold — and the behaviour — are unchanged.Test
mtu_above_the_read_buffer_still_opens_the_receive_windowopens a stream with an MTU of twice the read buffer and asserts the SYN-ACK window is non-zero; it fails on the old rule ("an empty read buffer advertised a zero window") and passes now. Theopenhelper gained an MTU-taking variant for it.Verified (nightly-2026-10-26)
fmt --check,clippy --all-targets --all-features -D warnings,test --all-features(43 unit + 23 doc).🤖 Generated with Claude Code