le-proxy: initiate use of the Winsock DLL

Closes: #803 (cherry-picked)
This commit is contained in:
linxiaohui 2019-04-18 17:10:33 +08:00 committed by Azat Khuzhin
parent 1cd8830de2
commit 16d8564a2c
No known key found for this signature in database
GPG Key ID: B86086848EF8686D

View File

@ -216,6 +216,13 @@ main(int argc, char **argv)
int use_ssl = 0;
struct evconnlistener *listener;
#ifdef _WIN32
WORD wVersionRequested;
WSADATA wsaData;
wVersionRequested = MAKEWORD(2, 2);
(void) WSAStartup(wVersionRequested, &wsaData);
#endif
if (argc < 3)
syntax();
@ -290,5 +297,9 @@ main(int argc, char **argv)
evconnlistener_free(listener);
event_base_free(base);
#ifdef _WIN32
WSACleanup();
#endif
return 0;
}