From d677f92b7f7f335a34b9b6c410a38dd6f402d421 Mon Sep 17 00:00:00 2001 From: chenjw28 <792430652@qq.com> Date: Mon, 14 Sep 2026 16:02:03 +0800 Subject: [PATCH] fix(main): consume reuse_port param on Windows builds SO_REUSEPORT is Unix-only; the parameter is only read inside the #[cfg(not(windows))] block, so -D warnings fails the build with an unused-variable error on Windows hosts while Linux CI stays green. Co-Authored-By: Claude Code --- src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.rs b/src/main.rs index d5f4b041..654f3aab 100644 --- a/src/main.rs +++ b/src/main.rs @@ -100,6 +100,10 @@ fn make_socket(addr: &SocketAddr, reuse_port: bool) -> std::io::Result { if reuse_port { socket.set_reuse_port(true)?; } + // SO_REUSEPORT is Unix-only; on Windows the flag is accepted but inert. + // Consume the parameter so `-D warnings` stays clean on Windows builds. + #[cfg(windows)] + let _ = reuse_port; // Disable Nagle's algorithm — send small responses (JSON, PROPFIND) // immediately instead of waiting up to 40ms for coalescing. socket.set_tcp_nodelay(true)?;