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:
parent
80737b1f8d
commit
2fbd711495
15
src/brain.c
15
src/brain.c
@ -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)
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user