mirror of
https://github.com/rclone/rclone.git
synced 2024-11-29 12:00:40 +08:00
vendor: pull in github.com/ncw/swift latest to fix reauth on big files
This commit is contained in:
parent
1c01d0b84a
commit
039e2a9649
2
go.mod
2
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
|
||||
|
|
2
go.sum
2
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=
|
||||
|
|
2
vendor/github.com/ncw/swift/README.md
generated
vendored
2
vendor/github.com/ncw/swift/README.md
generated
vendored
|
@ -150,3 +150,5 @@ Contributors
|
|||
- Arthur Paim Arnold <arthurpaimarnold@gmail.com>
|
||||
- Bruno Michel <bmichel@menfin.info>
|
||||
- Charles Hsu <charles0126@gmail.com>
|
||||
- Omar Ali <omarali@users.noreply.github.com>
|
||||
- Andreas Andersen <andreas@softwaredesign.se>
|
||||
|
|
21
vendor/github.com/ncw/swift/compatibility_1_6.go
generated
vendored
Normal file
21
vendor/github.com/ncw/swift/compatibility_1_6.go
generated
vendored
Normal file
|
@ -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"}
|
||||
}
|
||||
}
|
13
vendor/github.com/ncw/swift/compatibility_not_1_6.go
generated
vendored
Normal file
13
vendor/github.com/ncw/swift/compatibility_not_1_6.go
generated
vendored
Normal file
|
@ -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) {}
|
11
vendor/github.com/ncw/swift/swift.go
generated
vendored
11
vendor/github.com/ncw/swift/swift.go
generated
vendored
|
@ -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,
|
||||
// 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 {
|
||||
|
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user