mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-06 16:36:16 +08:00
Fix Visual Studio related bugs
This commit is contained in:
@@ -47,7 +47,13 @@ int tls13_server_main(int argc , char **argv)
|
||||
char buf[1600] = {0};
|
||||
size_t len = sizeof(buf);
|
||||
|
||||
#ifdef WIN32
|
||||
SOCKET sock;
|
||||
SOCKET conn_sock;
|
||||
#else
|
||||
int sock;
|
||||
int conn_sock;
|
||||
#endif
|
||||
struct sockaddr_in server_addr;
|
||||
struct sockaddr_in client_addr;
|
||||
#ifdef WIN32
|
||||
@@ -55,7 +61,7 @@ int tls13_server_main(int argc , char **argv)
|
||||
#else
|
||||
socklen_t client_addrlen;
|
||||
#endif
|
||||
int conn_sock;
|
||||
|
||||
|
||||
|
||||
argc--;
|
||||
@@ -181,7 +187,11 @@ restart:
|
||||
|
||||
if (tls13_send(&conn, (uint8_t *)buf, len, &sentlen) != 1) {
|
||||
fprintf(stderr, "%s: send failure, close connection\n", prog);
|
||||
#ifdef WIN32
|
||||
closesocket(conn.sock);
|
||||
#else
|
||||
close(conn.sock);
|
||||
#endif
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user