mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-09-16 14:51:37 +02:00
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:
co-authored by
Claude Opus 5
parent
3d6c31440c
commit
5a793e1d42
@@ -27,6 +27,10 @@ impl TestHttpServer {
|
|||||||
while !shutdown_signal.load(Ordering::Relaxed) {
|
while !shutdown_signal.load(Ordering::Relaxed) {
|
||||||
match listener.accept() {
|
match listener.accept() {
|
||||||
Ok((mut stream, _)) => {
|
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 _ = stream.set_read_timeout(Some(Duration::from_secs(1)));
|
||||||
let mut request = Vec::new();
|
let mut request = Vec::new();
|
||||||
let mut request_buf = [0u8; 4096];
|
let mut request_buf = [0u8; 4096];
|
||||||
|
|||||||
Reference in New Issue
Block a user