Skip to content

Commit

Permalink
Little change
Browse files Browse the repository at this point in the history
  • Loading branch information
RusJJ committed Feb 24, 2023
1 parent 5a1d9a4 commit 24d16b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion aml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ static size_t WriteToFileCB(void* buffer, size_t size, size_t nmemb, void* userd
void AML::DownloadFile(const char* url, const char* saveto)
{
if(!g_bEnableFileDownloads) return;

if(!curl) return;
curl_easy_reset(curl);

FILE* file = fopen(saveto, "wb");
if(!file) return;
Expand All @@ -245,6 +245,7 @@ void AML::DownloadFileToData(const char* url, char* out, size_t outLen)
{
if(!g_bEnableFileDownloads) return;
if(!curl) return;
curl_easy_reset(curl);

maxsizeof = outLen;
curl_easy_setopt(curl, CURLOPT_URL, url);
Expand Down
2 changes: 2 additions & 0 deletions modpaks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ static size_t WriteToDataCB(void* buffer, size_t size, size_t nmemb, void* userd
CURLcode DownloadFile(const char* url, const char* path)
{
if(!curl) return CURLE_FAILED_INIT;
curl_easy_reset(curl);

//if(remove(path) != -1) return DownloadFile(url, path);
//return CURLE_WRITE_ERROR;
Expand All @@ -51,6 +52,7 @@ CURLcode DownloadFile(const char* url, const char* path)
CURLcode DownloadFileToData(const char* url)
{
if(!curl) return CURLE_FAILED_INIT;
curl_easy_reset(curl);

curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false); // cURL fails at SSL/TLS here, for some reason
curl_easy_setopt(curl, CURLOPT_URL, url);
Expand Down

0 comments on commit 24d16b1

Please sign in to comment.