You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Bug #3410: Fix infinite loop after a failed network connection due to changed curl messaging (#3412)
* Curl 8.14.1 (or maybe earlier) has changed output messaging when curl exceptions are raised. This has caused the curl exception handling / retry handling to fail due to unable to match error log output.
* Add an exception fallback to ensure retry interval is enforced in case of unknown CurlException event
* Update calculateBackoff() function to prevent integer overflow
Copy file name to clipboardExpand all lines: src/onedrive.d
+27-7Lines changed: 27 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1714,7 +1714,7 @@ class OneDriveApi {
1714
1714
1715
1715
// Detail the curl exception, debug output only
1716
1716
if (debugLogging) {
1717
-
addLogEntry("Handling a specific Curl exception:", ["debug"]);
1717
+
addLogEntry("Handling a curl exception:", ["debug"]);
1718
1718
addLogEntry(to!string(response), ["debug"]);
1719
1719
}
1720
1720
@@ -1727,17 +1727,26 @@ class OneDriveApi {
1727
1727
setFreshConnectOption();
1728
1728
1729
1729
// What is contained in the curl error message?
1730
-
if (canFind(errorMessage, "Couldn't connect to server on handle") || canFind(errorMessage, "Couldn't resolve host name on handle") || canFind(errorMessage, "Timeout was reached on handle")) {
1730
+
// Handle the following:
1731
+
// - Couldn't connect to server on handle
1732
+
// - Could not connect to server on handle (changed noticed in curl 8.14.1, possibly done earlier ...)
1733
+
// - Couldn't resolve host name on handle
1734
+
// - Could not resolve host name on handle (changed noticed in curl 8.14.1, possibly done earlier ...)
1735
+
// - Timeout was reached on handle
1736
+
if (canFind(errorMessage, "connect to server on handle") || canFind(errorMessage, "resolve host name on handle") || canFind(errorMessage, "Timeout was reached on handle")) {
1731
1737
// Connectivity to Microsoft OneDrive was lost
1732
1738
addLogEntry("Internet connectivity to Microsoft OneDrive service has been interrupted .. re-trying in the background");
1733
1739
1734
1740
// What caused the initial curl exception?
1735
-
if (canFind(errorMessage, "Couldn't resolve host name on handle")) {
1741
+
// - DNS resolution issue
1742
+
if (canFind(errorMessage, "resolve host name on handle")) {
1736
1743
if (debugLogging) {addLogEntry("Unable to resolve server - DNS access blocked?", ["debug"]);}
1737
1744
}
1738
-
if (canFind(errorMessage, "Couldn't connect to server on handle")) {
1745
+
// - connection issue
1746
+
if (canFind(errorMessage, "connect to server on handle")) {
1739
1747
if (debugLogging) {addLogEntry("Unable to connect to server - HTTPS access blocked?", ["debug"]);}
1740
1748
}
1749
+
// - timeout issue
1741
1750
if (canFind(errorMessage, "Timeout was reached on handle")) {
1742
1751
// Common cause is libcurl trying IPv6 DNS resolution when there are only IPv4 DNS servers available
1743
1752
if (verboseLogging) {
@@ -1777,11 +1786,21 @@ class OneDriveApi {
1777
1786
thrownew OneDriveError("Zero disk space detected");
0 commit comments