diff options
author | Andy Pan <panjf2000@gmail.com> | 2023-02-27 12:07:57 +0800 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2023-02-28 04:49:22 +0000 |
commit | af2bc6de6203608f26217d59db0d1a31549272e6 (patch) | |
tree | 056ce6866c7822388c7d6c468a063cd518414bc5 /src/os | |
parent | 81cd9ff7dbf46a57710fd72330f2d60e3db959d0 (diff) | |
download | go-git-af2bc6de6203608f26217d59db0d1a31549272e6.tar.gz |
net,os: set the theoretical unlimited remaining bytes to max int64
Based on https://go-review.googlesource.com/c/go/+/466015/comment/073a63fa_7a9e485f
Change-Id: I3e1b035de6b8217c5fa5695e436f164b3058e33c
Reviewed-on: https://go-review.googlesource.com/c/go/+/471439
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Andy Pan <panjf2000@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src/os')
-rw-r--r-- | src/os/readfrom_linux.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/os/readfrom_linux.go b/src/os/readfrom_linux.go index 514d873ece..7e8024028e 100644 --- a/src/os/readfrom_linux.go +++ b/src/os/readfrom_linux.go @@ -112,7 +112,7 @@ func (f *File) copyFileRange(r io.Reader) (written int64, handled bool, err erro // the underlying io.Reader and the remaining amount of bytes if the assertion succeeds, // otherwise it just returns the original io.Reader and the theoretical unlimited remaining amount of bytes. func tryLimitedReader(r io.Reader) (*io.LimitedReader, io.Reader, int64) { - remain := int64(1 << 62) + var remain int64 = 1<<63 - 1 // by default, copy until EOF lr, ok := r.(*io.LimitedReader) if !ok { |