修复Windows编译的问题。

将Windows CI单独拿出来。在Windows环境下编译需要在cmake的时候增加-DWIN32=ON参数。
This commit is contained in:
Simon
2024-04-20 12:23:30 +08:00
committed by GitHub
parent 6f870889cf
commit 350e91af0a
5 changed files with 59 additions and 5 deletions

View File

@@ -2320,7 +2320,13 @@ void tls_cleanup(TLS_CONNECT *conn)
int tls_set_socket(TLS_CONNECT *conn, tls_socket_t sock)
{
int flags;
#ifdef WIN32
if( ioctlsocket(sock, FIONBIO, &flags) != 0) {
error_puts("socket in non-blocking mode");
//nginx will pass a socket in non-blocking mode
//return -1;
}
#else
if ((flags = fcntl(sock, F_GETFL)) == -1) {
error_print();
perror("fcntl error");
@@ -2331,6 +2337,7 @@ int tls_set_socket(TLS_CONNECT *conn, tls_socket_t sock)
//nginx will pass a socket in non-blocking mode
//return -1;
}
#endif
conn->sock = sock;
return 1;
}