rclone/lib
Nick Craig-Wood 2e2451f8ec lib/rest: fix problems re-using HTTP connections
Before this fix, it was noticed that the rclone webdav client did not
re-use HTTP connections when it should have been.

This turned out to be because rclone was not draining the HTTP bodies
when it was not expecting a response.

From the Go docs:

> If the returned error is nil, the Response will contain a non-nil
> Body which the user is expected to close. If the Body is not both
> read to EOF and closed, the Client's underlying RoundTripper
> (typically Transport) may not be able to re-use a persistent TCP
> connection to the server for a subsequent "keep-alive" request.

This fixes the problem by draining up to 10MB of data from an HTTP
response if the NoResponse flag is set, or at the end of a JSON or XML
response (which could have some whitespace on the end).

See: https://forum.rclone.org/t/webdav-with-persistent-connections/37024/
2023-03-26 17:19:48 +01:00
..
atexit lib/atexit: ensure OnError only calls cancel function once 2023-03-22 12:50:58 +00:00
bucket bucket: add Join function for a simplified path.Join 2023-03-03 15:51:00 +00:00
buildinfo lib: fix typos found by codespell 2023-03-24 20:40:52 +00:00
cache lib/cache: fix alias backend shutting down too soon 2022-11-09 16:29:23 +00:00
daemonize build: add package comments to silence revive linter 2022-08-28 13:43:51 +02:00
debug rc: Add commands to set GC Percent & Memory Limit (1.19+) 2022-11-10 12:07:18 +00:00
dircache lib: fix typos found by codespell 2023-03-24 20:40:52 +00:00
encoder Replace deprecated ioutil 2022-11-07 11:41:47 +00:00
env docs: punctuation cleanup 2021-10-20 22:56:19 +02:00
errors lib: fix typos found by codespell 2023-03-24 20:40:52 +00:00
exitcode cmd: Move exit status codes to separate package 2021-07-07 17:59:26 +01:00
file authorize: add support for custom templates 2023-02-24 15:08:38 +00:00
http cmd/rcd: Fix command docs to include command specific prefix (#6675) 2023-03-22 11:47:35 +00:00
israce build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
jwtutil Replace deprecated ioutil 2022-11-07 11:41:47 +00:00
kv build: add package comments to silence revive linter 2022-08-28 13:43:51 +02:00
mmap build: add package comments to silence revive linter 2022-08-28 13:43:51 +02:00
oauthutil lib: avoid unnecessary use of fmt.Sprintf for string constant 2023-03-26 14:28:15 +02:00
pacer build: reformat comments to pass go1.19 vet 2022-08-05 16:35:41 +01:00
plugin Replace deprecated ioutil 2022-11-07 11:41:47 +00:00
pool test: Don't run unreliable tests on CI #4171 2020-06-15 21:34:37 +01:00
random Remove github.com/pkg/errors and replace with std library version 2021-11-07 11:53:30 +00:00
ranges Spelling fixes 2020-10-14 15:21:31 +01:00
readers test: use decompressed.String() instead of string(decompressed.Bytes()) 2023-03-26 14:28:15 +02:00
rest lib/rest: fix problems re-using HTTP connections 2023-03-26 17:19:48 +01:00
structs test: do not test deprecated and unused Dial and DialTLS functions on http Transport type 2023-03-26 14:28:15 +02:00
terminal lib: fix typos found by codespell 2023-03-24 20:40:52 +00:00
version Fix lint issues reported by staticcheck 2022-06-13 21:13:50 +02:00