P4.1-001: 2s read timeout on accepted sockets (idle preconnect wedged the loop)
A browser speculative preconnection sends no bytes; the sequential accept loop blocked in read() on it forever while real requests sat in the backlog — LAN clients saw a dead server while curl (connect+send in one shot) worked. SO_RCVTIMEO frees the loop. Regression case pinned in tests/server_http.sx (fails 000 pre-fix, 200 post-fix).
This commit is contained in:
@@ -290,6 +290,7 @@ run_server :: (store_dir: string, port: s64) -> !ServeErr {
|
||||
while true {
|
||||
client := sock.accept(fd, null, null);
|
||||
if client < 0 { continue; }
|
||||
http.set_read_timeout(client, 2);
|
||||
|
||||
gpa := GPA.init();
|
||||
arena := Arena.init(xx gpa, 65536);
|
||||
|
||||
Reference in New Issue
Block a user