Fix cookies getting overwritten

Sometimes curl handles in downloader and galaxy api class could overwrite cookies with blank cookies
Fixed this by not setting CURLOPT_COOKIEJAR by default and only using it for curl handles in website class
This commit is contained in:
Sude 2023-03-24 16:08:01 +02:00
parent 12281317aa
commit a81d63b375
2 changed files with 2 additions and 2 deletions

View File

@ -772,7 +772,6 @@ void Util::CurlHandleSetDefaultOptions(CURL* curlhandle, const CurlConfig& conf)
curl_easy_setopt(curlhandle, CURLOPT_CONNECTTIMEOUT, conf.iTimeout);
curl_easy_setopt(curlhandle, CURLOPT_FAILONERROR, true);
curl_easy_setopt(curlhandle, CURLOPT_COOKIEFILE, conf.sCookiePath.c_str());
curl_easy_setopt(curlhandle, CURLOPT_COOKIEJAR, conf.sCookiePath.c_str());
curl_easy_setopt(curlhandle, CURLOPT_SSL_VERIFYPEER, conf.bVerifyPeer);
curl_easy_setopt(curlhandle, CURLOPT_VERBOSE, conf.bVerbose);
curl_easy_setopt(curlhandle, CURLOPT_MAX_RECV_SPEED_LARGE, conf.iDownloadRate);

View File

@ -21,6 +21,7 @@ Website::Website()
curlhandle = curl_easy_init();
Util::CurlHandleSetDefaultOptions(curlhandle, Globals::globalConfig.curlConf);
curl_easy_setopt(curlhandle, CURLOPT_COOKIEJAR, Globals::globalConfig.curlConf.sCookiePath.c_str());
}
Website::~Website()