1
0
mirror of https://github.com/rclone/rclone.git synced 2026-02-24 08:32:53 +00:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Nick Craig-Wood
53bbe891d3 lib/rest: retry errors due to failed JSON decoding - fixes #8383
These errors are almost always caused by an overloaded proxy somewhere
in the chain returning HTML so they are worth retrying.
2025-02-14 14:47:09 +00:00
Nick Craig-Wood
4aaef7472d docs: add FileLu as sponsors and tidy sponsor logos 2025-02-14 12:33:26 +00:00
4 changed files with 13 additions and 41 deletions

View File

@@ -16,10 +16,10 @@ import (
)
const (
baseEndpoint = "https://www.icloud.com.cn"
homeEndpoint = "https://www.icloud.com.cn"
setupEndpoint = "https://setup.icloud.com.cn/setup/ws/1"
authEndpoint = "https://idmsa.apple.com.cn/appleauth/auth"
baseEndpoint = "https://www.icloud.com"
homeEndpoint = "https://www.icloud.com"
setupEndpoint = "https://setup.icloud.com/setup/ws/1"
authEndpoint = "https://idmsa.apple.com/appleauth/auth"
)
type sessionSave func(*Session)

View File

@@ -5,32 +5,6 @@ description: "Rclone Changelog"
# Changelog
## v1.69.1 - 2025-02-14
[See commits](https://github.com/rclone/rclone/compare/v1.69.0...v1.69.1)
* Bug Fixes
* lib/oauthutil: Fix redirect URL mismatch errors (Nick Craig-Wood)
* bisync: Fix listings missing concurrent modifications (nielash)
* serve s3: Fix list objects encoding-type (Nick Craig-Wood)
* fs: Fix confusing "didn't find section in config file" error (Nick Craig-Wood)
* doc fixes (Christoph Berger, Dimitri Papadopoulos, Matt Ickstadt, Nick Craig-Wood, Tim White, Zachary Vorhies)
* build: Added parallel docker builds and caching for go build in the container (Anagh Kumar Baranwal)
* VFS
* Fix the cache failing to upload symlinks when `--links` was specified (Nick Craig-Wood)
* Fix race detected by race detector (Nick Craig-Wood)
* Close the change notify channel on Shutdown (izouxv)
* B2
* Fix "fatal error: concurrent map writes" (Nick Craig-Wood)
* Iclouddrive
* Add notes on ADP and Missing PCS cookies (Nick Craig-Wood)
* Onedrive
* Mark German (de) region as deprecated (Nick Craig-Wood)
* S3
* Added new storage class to magalu provider (Bruno Fernandes)
* Add DigitalOcean regions SFO2, LON1, TOR1, BLR1 (jkpe)
* Add latest Linode Object Storage endpoints (jbagwell-akamai)
## v1.69.0 - 2025-01-12
[See commits](https://github.com/rclone/rclone/compare/v1.68.0...v1.69.0)

View File

@@ -237,14 +237,5 @@ func TestCountError(t *testing.T) {
}
func percentDiff(start, end uint64) uint64 {
if start == 0 {
return 0 // Handle zero start value to avoid division by zero
}
var diff uint64
if end > start {
diff = end - start // Handle case where end is larger than start
} else {
diff = start - end
}
return (diff * 100) / start
return (start - end) * 100 / start
}

View File

@@ -17,6 +17,7 @@ import (
"sync"
"github.com/rclone/rclone/fs"
"github.com/rclone/rclone/fs/fserrors"
"github.com/rclone/rclone/lib/readers"
)
@@ -189,7 +190,13 @@ func checkDrainAndClose(r io.ReadCloser, err *error) {
func DecodeJSON(resp *http.Response, result interface{}) (err error) {
defer checkDrainAndClose(resp.Body, &err)
decoder := json.NewDecoder(resp.Body)
return decoder.Decode(result)
err = decoder.Decode(result)
if err != nil {
// Retry this as it is likely some overloaded server sending HTML instead of JSON
contentType := resp.Header.Get("Content-Type")
err = fserrors.RetryError(fmt.Errorf("failed to decode JSON from Content-Type: %q: %v", contentType, err))
}
return err
}
// DecodeXML decodes resp.Body into result