telnet: return error if WSAEventSelect fails

Reported-by: Joshua Rogers
Closes #18886
This commit is contained in:
Daniel Stenberg 2025-10-06 14:59:53 +02:00
parent 3b18aeb8bd
commit 6d9636abd1
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -1371,7 +1371,7 @@ static CURLcode telnet_do(struct Curl_easy *data, bool *done)
/* Tell Winsock what events we want to listen to */
if(WSAEventSelect(sockfd, event_handle, FD_READ|FD_CLOSE) == SOCKET_ERROR) {
WSACloseEvent(event_handle);
return CURLE_OK;
return CURLE_RECV_ERROR;
}
/* The get the Windows file handle for stdin */