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.
This commit is contained in:
dmiller 2026-05-15 16:23:46 +00:00
parent ebdec1fa3e
commit e9861daf84

View file

@ -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) {