mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-04 10:42:04 +00:00
Enhancements
Add support for parsing Clash subscriptions in JSON format. Add retry for downloading files. Optimize codes. Update local rulesets and configs.
This commit is contained in:
69 files changed
+807
-1285
No files matched your search
+10
-1
@@ -95,7 +95,16 @@ static std::string curlGet(const std::string &url, const std::string &proxy, std
|
||||
curl_easy_setopt(curl_handle, CURLOPT_HEADERFUNCTION, writer);
|
||||
curl_easy_setopt(curl_handle, CURLOPT_HEADERDATA, &response_headers);
|
||||
|
||||
return_code = curl_easy_perform(curl_handle);
|
||||
unsigned int fail_count = 0, max_fails = 1;
|
||||
while(true)
|
||||
{
|
||||
return_code = curl_easy_perform(curl_handle);
|
||||
if(return_code == CURLE_OK || max_fails >= fail_count)
|
||||
break;
|
||||
else
|
||||
fail_count++;
|
||||
}
|
||||
|
||||
curl_easy_getinfo(curl_handle, CURLINFO_HTTP_CODE, &retVal);
|
||||
curl_easy_cleanup(curl_handle);
|
||||
|
||||
|
||||
Reference in new issue
Block a user