]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.11] net: refactor readerAtEOF splice test
authorAndrei Tudor Călin <mail@acln.ro>
Thu, 30 Aug 2018 04:55:05 +0000 (06:55 +0200)
committerIan Lance Taylor <iant@golang.org>
Thu, 30 Aug 2018 23:15:51 +0000 (23:15 +0000)
commitad116f72b96530edeece030da4ee3f7f7d711ddd
treef749deaa9d83e754424214caa851fef5abbc8442
parent359a02b0fc4e195fb0be41ba5b74beb2842139ad
[release-branch.go1.11] net: refactor readerAtEOF splice test

Refactor TestSplice/readerAtEOF to handle cases where we disable
splice on older kernels better.

If splice is disabled, net.splice and poll.Splice do not get to
observe EOF on the reader, because poll.Splice returns immediately
with EINVAL. The test fails unexpectedly, because the splice operation
is reported as not handled.

This change refactors the test to handle the aforementioned case
correctly, by not calling net.splice directly, but using a higher
level check.

Fixes #27355.

Change-Id: I0d5606b4775213f2dbbb84ef82ddfc3bab662a31
Reviewed-on: https://go-review.googlesource.com/132096
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit bd49b3d580731d8f391e40fb9e2f17301651cede)
Reviewed-on: https://go-review.googlesource.com/132281
Reviewed-by: Andrew Bonventre <andybons@golang.org>
src/net/splice_test.go