|
@@ -9784,6 +9784,10 @@ void _bfg_clean_up(void)
|
|
|
free(cpus);
|
|
free(cpus);
|
|
|
|
|
|
|
|
curl_global_cleanup();
|
|
curl_global_cleanup();
|
|
|
|
|
+
|
|
|
|
|
+#ifdef WIN32
|
|
|
|
|
+ WSACleanup();
|
|
|
|
|
+#endif
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void _quit(int status)
|
|
void _quit(int status)
|
|
@@ -10439,6 +10443,15 @@ int main(int argc, char *argv[])
|
|
|
setup_pthread_cancel_workaround();
|
|
setup_pthread_cancel_workaround();
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
+#ifdef WIN32
|
|
|
|
|
+ {
|
|
|
|
|
+ WSADATA wsa;
|
|
|
|
|
+ i = WSAStartup(MAKEWORD(2, 2), &wsa);
|
|
|
|
|
+ if (i)
|
|
|
|
|
+ quit(1, "Failed to initialise Winsock: %s", bfg_strerror(i, BST_SOCKET));
|
|
|
|
|
+ }
|
|
|
|
|
+#endif
|
|
|
|
|
+
|
|
|
/* This dangerous functions tramples random dynamically allocated
|
|
/* This dangerous functions tramples random dynamically allocated
|
|
|
* variables so do it before anything at all */
|
|
* variables so do it before anything at all */
|
|
|
if (unlikely(curl_global_init(CURL_GLOBAL_ALL)))
|
|
if (unlikely(curl_global_init(CURL_GLOBAL_ALL)))
|