Clear the inherited non-blocking flag on accepted sockets in the CLI test server (#668)

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Gregory Schier
2026-09-15 13:22:01 -07:00
committed by GitHub
co-authored by Claude Opus 5
parent 3d6c31440c
commit 5a793e1d42
@@ -27,6 +27,10 @@ impl TestHttpServer {
while !shutdown_signal.load(Ordering::Relaxed) {
match listener.accept() {
Ok((mut stream, _)) => {
// macOS and the BSDs hand back accepted sockets carrying the
// listener's non-blocking flag, which leaves the read timeout
// below with nothing to govern.
let _ = stream.set_nonblocking(false);
let _ = stream.set_read_timeout(Some(Duration::from_secs(1)));
let mut request = Vec::new();
let mut request_buf = [0u8; 4096];