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:
Tindy X committed 2020-06-05 10:52:59 +08:00
1 parent ac11260747
commit 8d0fc42ad3
69 files changed
+807 -1285

No files matched your search

+10 -1
View File
@@ -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);