1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-23 07:08:19 +00:00

Move WSAStartup() call back to user_options

This commit is contained in:
Jens Steube 2018-10-31 11:14:21 +01:00
parent 80737b1f8d
commit 2fbd711495
2 changed files with 19 additions and 15 deletions

View File

@ -892,21 +892,6 @@ bool brain_client_connect (hc_device_param_t *device_param, const status_ctx_t *
memset (&device_param->brain_link_recv_speed, 0, sizeof (link_speed_t));
memset (&device_param->brain_link_send_speed, 0, sizeof (link_speed_t));
#if defined (_WIN)
WSADATA wsaData;
WORD wVersionRequested = MAKEWORD (2,2);
const int iResult = WSAStartup (wVersionRequested, &wsaData);
if (iResult != NO_ERROR)
{
fprintf (stderr, "WSAStartup: %s\n", strerror (errno));
return -1;
}
#endif
const int brain_link_client_fd = socket (AF_INET, SOCK_STREAM, 0);
if (brain_link_client_fd == -1)

View File

@ -1871,6 +1871,25 @@ int user_options_check_files (hashcat_ctx_t *hashcat_ctx)
// brain
#ifdef WITH_BRAIN
#if defined (_WIN)
if (user_options->brain_client == true)
{
WSADATA wsaData;
WORD wVersionRequested = MAKEWORD (2,2);
const int iResult = WSAStartup (wVersionRequested, &wsaData);
if (iResult != NO_ERROR)
{
fprintf (stderr, "WSAStartup: %s\n", strerror (errno));
return -1;
}
}
#endif
if (user_options->brain_host)
{
struct addrinfo hints;