From 672737f9538194f0bab6d424596cb15c6625e3d7 Mon Sep 17 00:00:00 2001 From: Zhi Guan Date: Thu, 28 May 2026 09:07:03 +0800 Subject: [PATCH] Update tls13_client.c --- tools/tls13_client.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/tls13_client.c b/tools/tls13_client.c index b2cfa49b..9d7a735a 100644 --- a/tools/tls13_client.c +++ b/tools/tls13_client.c @@ -16,6 +16,12 @@ #include #include +#ifdef _WIN32 +#define tls_stdio_fileno(fp) _fileno(fp) +#else +#define tls_stdio_fileno(fp) fileno(fp) +#endif + static const char *http_get = "GET / HTTP/1.1\r\n" @@ -645,7 +651,7 @@ bad: FD_SET(conn.sock, &fds_recv); // listen stdin - FD_SET(fileno(stdin), &fds_recv); + FD_SET(tls_stdio_fileno(stdin), &fds_recv); if (sent_len > 0) { @@ -677,7 +683,7 @@ bad: } - if (FD_ISSET(fileno(stdin), &fds_recv)) { + if (FD_ISSET(tls_stdio_fileno(stdin), &fds_recv)) { memset(send_buf, 0, sizeof(send_buf));