Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

vendor: pull in github.com/ncw/swift latest to fix reauth on big files

Nick Craig-Wood039e2a9649d9
diff --git a/go.mod b/go.mod
index 762c84e1b..901e8794c 100644
--- a/go.mod
+++ b/go.mod
@@ -29,7 +29,7 @@ require (
github.com/kr/pretty v0.1.0 // indirect
github.com/mattn/go-runewidth v0.0.3 // indirect
github.com/ncw/go-acd v0.0.0-20171120105400-887eb06ab6a2
- github.com/ncw/swift v1.0.42
+ github.com/ncw/swift v1.0.43
github.com/nsf/termbox-go v0.0.0-20181027232701-60ab7e3d12ed
github.com/okzk/sdnotify v0.0.0-20180710141335-d9becc38acbd
github.com/patrickmn/go-cache v2.1.0+incompatible
diff --git a/go.sum b/go.sum
index eeada2786..15dcc2cca 100644
--- a/go.sum
+++ b/go.sum
@@ -68,6 +68,8 @@ github.com/ncw/go-acd v0.0.0-20171120105400-887eb06ab6a2 h1:VlXvEx6JbFp7F9iz92zX
github.com/ncw/go-acd v0.0.0-20171120105400-887eb06ab6a2/go.mod h1:MLIrzg7gp/kzVBxRE1olT7CWYMCklcUWU+ekoxOD9x0=
github.com/ncw/swift v1.0.42 h1:ztvRb6hs52IHOcaYt73f9lXYLIeIuWgdooRDhdyllGI=
github.com/ncw/swift v1.0.42/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM=
+github.com/ncw/swift v1.0.43 h1:TZn2l/bPV0CqG+/G5BFh/ROWnyX7dL2D0URaOjNQRsw=
+github.com/ncw/swift v1.0.43/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM=
github.com/nsf/termbox-go v0.0.0-20181027232701-60ab7e3d12ed h1:bAVGG6B+R5qpSylrrA+BAMrzYkdAoiTaKPVxRB+4cyM=
github.com/nsf/termbox-go v0.0.0-20181027232701-60ab7e3d12ed/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ=
github.com/okzk/sdnotify v0.0.0-20180710141335-d9becc38acbd h1:+iAPaTbi1gZpcpDwe/BW1fx7Xoesv69hLNGPheoyhBs=
diff --git a/vendor/github.com/ncw/swift/README.md b/vendor/github.com/ncw/swift/README.md
index 539f0f768..a114762c3 100644
--- a/vendor/github.com/ncw/swift/README.md
+++ b/vendor/github.com/ncw/swift/README.md
@@ -150,3 +150,5 @@ Contributors
- Arthur Paim Arnold <[email protected]>
- Bruno Michel <[email protected]>
- Charles Hsu <[email protected]>
+- Omar Ali <[email protected]>
+- Andreas Andersen <[email protected]>
diff --git a/vendor/github.com/ncw/swift/compatibility_1_6.go b/vendor/github.com/ncw/swift/compatibility_1_6.go
new file mode 100644
index 000000000..030cbc446
--- /dev/null
+++ b/vendor/github.com/ncw/swift/compatibility_1_6.go
@@ -0,0 +1,21 @@
+// +build go1.6
+
+package swift
+
+import (
+ "net/http"
+ "time"
+)
+
+const IS_AT_LEAST_GO_16 = true
+
+func SetExpectContinueTimeout(tr *http.Transport, t time.Duration) {
+ tr.ExpectContinueTimeout = t
+}
+
+func AddExpectAndTransferEncoding(req *http.Request, hasContentLength bool) {
+ req.Header.Add("Expect", "100-continue")
+ if !hasContentLength {
+ req.TransferEncoding = []string{"chunked"}
+ }
+}
diff --git a/vendor/github.com/ncw/swift/compatibility_not_1_6.go b/vendor/github.com/ncw/swift/compatibility_not_1_6.go
new file mode 100644
index 000000000..aabb44e2b
--- /dev/null
+++ b/vendor/github.com/ncw/swift/compatibility_not_1_6.go
@@ -0,0 +1,13 @@
+// +build !go1.6
+
+package swift
+
+import (
+ "net/http"
+ "time"
+)
+
+const IS_AT_LEAST_GO_16 = false
+
+func SetExpectContinueTimeout(tr *http.Transport, t time.Duration) {}
+func AddExpectAndTransferEncoding(req *http.Request, hasContentLength bool) {}
diff --git a/vendor/github.com/ncw/swift/swift.go b/vendor/github.com/ncw/swift/swift.go
index d98c77af7..4f47be126 100644
--- a/vendor/github.com/ncw/swift/swift.go
+++ b/vendor/github.com/ncw/swift/swift.go
@@ -423,12 +423,15 @@ func (c *Connection) setDefaults() {
c.Timeout = 60 * time.Second
}
if c.Transport == nil {
- c.Transport = &http.Transport{
+ t := &http.Transport{
// TLSClientConfig: &tls.Config{RootCAs: pool},
// DisableCompression: true,
- Proxy: http.ProxyFromEnvironment,
- MaxIdleConnsPerHost: 2048,
+ Proxy: http.ProxyFromEnvironment,
+ // Half of linux's default open files limit (1024).
+ MaxIdleConnsPerHost: 512,
}
+ SetExpectContinueTimeout(t, 5*time.Second)
+ c.Transport = t
}
if c.client == nil {
c.client = &http.Client{
@@ -720,6 +723,10 @@ func (c *Connection) Call(targetUrl string, p RequestOpts) (resp *http.Response,
}
req.Header.Add("User-Agent", c.UserAgent)
req.Header.Add("X-Auth-Token", authToken)
+
+ _, hasCL := p.Headers["Content-Length"]
+ AddExpectAndTransferEncoding(req, hasCL)
+
resp, err = c.doTimeoutRequest(timer, req)
if err != nil {
if (p.Operation == "HEAD" || p.Operation == "GET") && retries > 0 {
diff --git a/vendor/modules.txt b/vendor/modules.txt
index a8e155977..2b293c0b8 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -97,7 +97,7 @@ github.com/kr/fs
github.com/mattn/go-runewidth
# github.com/ncw/go-acd v0.0.0-20171120105400-887eb06ab6a2
github.com/ncw/go-acd
-# github.com/ncw/swift v1.0.42
+# github.com/ncw/swift v1.0.43
github.com/ncw/swift
# github.com/nsf/termbox-go v0.0.0-20181027232701-60ab7e3d12ed
github.com/nsf/termbox-go