mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-24 19:52:08 +00:00
Avoid double initialization of CURL
This commit is contained in:
parent
770ee7b53c
commit
c04dd70a43
1 changed files with 7 additions and 4 deletions
|
@ -1609,11 +1609,13 @@ boolean CURLPrepareFile(const char* url, int dfilenum)
|
|||
I_Error("Attempted to download files in -nodownload mode");
|
||||
#endif
|
||||
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
if (!multi_handle)
|
||||
{
|
||||
curl_global_init(CURL_GLOBAL_ALL);
|
||||
multi_handle = curl_multi_init();
|
||||
}
|
||||
|
||||
http_handle = curl_easy_init();
|
||||
multi_handle = curl_multi_init();
|
||||
|
||||
if (http_handle && multi_handle)
|
||||
{
|
||||
I_mkdir(downloaddir, 0755);
|
||||
|
@ -1782,10 +1784,11 @@ void CURLGetFile(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (!filedownload.remaining)
|
||||
if (!filedownload.remaining || !filedownload.http_running)
|
||||
{
|
||||
curl_multi_cleanup(multi_handle);
|
||||
curl_global_cleanup();
|
||||
multi_handle = NULL;
|
||||
}
|
||||
filedownload.http_running = false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue