Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion vlib/net/http/server_tls_idle.v
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,16 @@ fn (mut t TlsIdleConnTracker) close_idle() {
t.closing = true
handles := t.handles.clone()
t.handles.clear()
t.mu.unlock()
// Shut down handles under the lock: a worker racing through
// unmark_idle → conn.shutdown() → net.close(fd) could cause the OS
// to reuse the fd before we call net.shutdown here, hitting an
// unrelated socket. Holding the lock keeps unmark_idle serialized
// with this loop, closing the window.
for handle in handles {
net.shutdown(handle)
$if windows {
net.close(handle) or {}
}
}
t.mu.unlock()
Comment thread
JalonSolov marked this conversation as resolved.
Outdated
}
3 changes: 0 additions & 3 deletions vlib/net/http/server_tls_notd_use_openssl.v
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ fn (mut s Server) listen_and_serve_tls() {
}
continue
}
if s.read_timeout > 0 {
conn.set_read_timeout(s.read_timeout)
}
ch <- conn
}
ch.close()
Expand Down
Loading