]> Cypherpunks repositories - gostls13.git/commitdiff
internal/poll: fix the verbose condition in splice
authorAndy Pan <panjf2000@gmail.com>
Thu, 19 Nov 2020 09:30:27 +0000 (17:30 +0800)
committerTobias Klauser <tobias.klauser@gmail.com>
Tue, 23 Feb 2021 10:04:13 +0000 (10:04 +0000)
Change-Id: I0b433ea1a78632de20ea58c48c9be0f1fb6eb083
Reviewed-on: https://go-review.googlesource.com/c/go/+/271499
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>

src/internal/poll/splice_linux.go

index 01baf14ed717eda5b08fd24c3da51fefcc7de5ea..968bc44a5ffd4d55e419897f73dc6673e6ce3c5f 100644 (file)
@@ -52,7 +52,7 @@ func Splice(dst, src *FD, remain int64) (written int64, handled bool, sc string,
                // If inPipe == 0 && err == nil, src is at EOF, and the
                // transfer is complete.
                handled = handled || (err != syscall.EINVAL)
-               if err != nil || (inPipe == 0 && err == nil) {
+               if err != nil || inPipe == 0 {
                        break
                }
                n, err = splicePump(dst, prfd, inPipe)