From e9861daf846c0388caae638ddf69ef6888cb73da Mon Sep 17 00:00:00 2001 From: dmiller Date: Fri, 15 May 2026 16:23:46 +0000 Subject: [PATCH] Avoid timeout on STDIN socket. Fixes #3291. Windows enforces a 120-second timeout for sockets in FIN_WAIT_2, so the STDIN socket was being forcibly closed after 2 minutes. --- nbase/nbase_winunix.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/nbase/nbase_winunix.c b/nbase/nbase_winunix.c index bd3f805c0..2b8678419 100644 --- a/nbase/nbase_winunix.c +++ b/nbase/nbase_winunix.c @@ -115,8 +115,6 @@ static DWORD WINAPI win_stdin_thread_func(void *data) { closesocket(tdata->socket_l); tdata->socket_l = INVALID_SOCKET; - if (SOCKET_ERROR == shutdown(socket_w, SD_RECEIVE)) - goto ThreadCleanup; for (;;) { if (ReadFile(tdata->stdin_handle, buffer, sizeof(buffer), &n, NULL) == 0) @@ -236,10 +234,6 @@ int win_stdin_start_thread(void) { //fprintf(stderr, "connect error: %d", socket_errno()); break; } - if (SOCKET_ERROR == shutdown(socket_r, SD_SEND)) { - //fprintf(stderr, "shutdown error: %d", socket_errno()); - break; - } /* Set the stdin handle to read from the socket. */ if (SetStdHandle(STD_INPUT_HANDLE, (HANDLE) socket_r) == 0) {