Fix Visual Studio related bugs

This commit is contained in:
Zhi Guan
2022-10-09 12:55:32 +08:00
parent dc58a88588
commit 6faeb627ed
16 changed files with 91 additions and 28 deletions

View File

@@ -49,7 +49,11 @@ int tls13_client_main(int argc, char *argv[])
char *pass = NULL;
struct hostent *hp;
struct sockaddr_in server;
#ifdef WIN32
SOCKET sock;
#else
int sock;
#endif
TLS_CTX ctx;
TLS_CONNECT conn;
char buf[1024] = {0};
@@ -194,7 +198,11 @@ bad:
}
end:
#ifdef WIN32
closesocket(sock);
#else
close(sock);
#endif
tls_ctx_cleanup(&ctx);
tls_cleanup(&conn);
return 0;