mirror of
https://github.com/abraunegg/onedrive
synced 2026-03-14 14:35:46 +01:00
Fix Bug #3463: Force DNS Timeout when forcing a libcurl fresh connection
* Force DNS Timeout when forcing a libcurl fresh connection which will force DNS resolution as stale cache internally in curl is not being released
This commit is contained in:
parent
18d267912e
commit
7575603757
1 changed files with 11 additions and 2 deletions
|
|
@ -1752,8 +1752,7 @@ class OneDriveApi {
|
|||
addLogEntry("Internet connectivity to Microsoft OneDrive service has been restored");
|
||||
}
|
||||
// unset the fresh connect option as this then creates performance issues if left enabled
|
||||
if (debugLogging) {addLogEntry("Unsetting libcurl to use a fresh connection as this causes a performance impact if left enabled", ["debug"]);}
|
||||
curlEngine.http.handle.set(CurlOption.fresh_connect,0);
|
||||
unsetFreshConnectOption();
|
||||
}
|
||||
|
||||
// On successful processing, break out of the loop
|
||||
|
|
@ -2095,6 +2094,16 @@ class OneDriveApi {
|
|||
private void setFreshConnectOption() {
|
||||
if (debugLogging) {addLogEntry("Configuring libcurl to use a fresh connection for re-try", ["debug"]);}
|
||||
curlEngine.http.handle.set(CurlOption.fresh_connect,1);
|
||||
//curlEngine.http.handle.set(CurlOption.dns_cache_timeout, 0);
|
||||
curlEngine.http.dnsTimeout = (dur!"seconds"(0));
|
||||
}
|
||||
|
||||
// Unset the libcurl fresh connection options
|
||||
private void unsetFreshConnectOption() {
|
||||
if (debugLogging) {addLogEntry("Unsetting libcurl to use a fresh connection as this causes a performance impact if left enabled", ["debug"]);}
|
||||
curlEngine.http.handle.set(CurlOption.fresh_connect,0);
|
||||
//curlEngine.http.handle.set(CurlOption.dns_cache_timeout, 0);
|
||||
curlEngine.http.dnsTimeout = (dur!"seconds"(appConfig.getValueLong("dns_timeout")));
|
||||
}
|
||||
|
||||
// Generate a HTTP 'reason' based on the HTTP 'code'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue