From a2974a9a8bd728266477dacb4dc02919d1e278ef Mon Sep 17 00:00:00 2001 From: Zhi Guan Date: Mon, 8 Dec 2025 20:45:35 +0800 Subject: [PATCH] Update tls.c --- src/tls.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/tls.c b/src/tls.c index 31f3ba28..806295ab 100644 --- a/src/tls.c +++ b/src/tls.c @@ -2319,14 +2319,15 @@ void tls_cleanup(TLS_CONNECT *conn) int tls_set_socket(TLS_CONNECT *conn, tls_socket_t sock) { - int flags = 0; #ifdef WIN32 - if( ioctlsocket(sock, FIONBIO, (u_long*)&flags) != 0) { + u_long flags = 0; + if( ioctlsocket(sock, FIONBIO, &flags) != 0) { error_puts("socket in non-blocking mode"); //nginx will pass a socket in non-blocking mode - //return -1; + //return -1; // FIXME } #else + int flags = 0; if ((flags = fcntl(sock, F_GETFL)) == -1) { error_print(); perror("fcntl error"); @@ -2335,7 +2336,7 @@ int tls_set_socket(TLS_CONNECT *conn, tls_socket_t sock) if (flags & O_NONBLOCK) { error_puts("socket in non-blocking mode"); //nginx will pass a socket in non-blocking mode - //return -1; + //return -1; // FIXME } #endif conn->sock = sock;