"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
fshttp: prevent overlap of HTTP headers in logs
Nathan Collinsbe19d6a4037c
diff --git a/fs/fshttp/http.go b/fs/fshttp/http.goindex 1debb2a74..11ed0da4b 100644--- a/fs/fshttp/http.go+++ b/fs/fshttp/http.go@@ -31,6 +31,7 @@ var (noTransport = new(sync.Once)tpsBucket *rate.Limiter // for limiting number of http transactions per secondcookieJar, _ = cookiejar.New(&cookiejar.Options{PublicSuffixList: publicsuffix.List})+ logMutex sync.Mutex)// StartHTTPTokenBucket starts the token bucket if necessary@@ -331,15 +332,18 @@ func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err errorif t.dump&fs.DumpAuth == 0 {buf = cleanAuths(buf)}+ logMutex.Lock()fs.Debugf(nil, "%s", separatorReq)fs.Debugf(nil, "%s (req %p)", "HTTP REQUEST", req)fs.Debugf(nil, "%s", string(buf))fs.Debugf(nil, "%s", separatorReq)+ logMutex.Unlock()}// Do round tripresp, err = t.Transport.RoundTrip(req)// Logf responseif t.dump&(fs.DumpHeaders|fs.DumpBodies|fs.DumpAuth|fs.DumpRequests|fs.DumpResponses) != 0 {+ logMutex.Lock()fs.Debugf(nil, "%s", separatorResp)fs.Debugf(nil, "%s (req %p)", "HTTP RESPONSE", req)if err != nil {@@ -349,6 +353,7 @@ func (t *Transport) RoundTrip(req *http.Request) (resp *http.Response, err errorfs.Debugf(nil, "%s", string(buf))}fs.Debugf(nil, "%s", separatorResp)+ logMutex.Unlock()}if err == nil {checkServerTime(req, resp)