]> Cypherpunks repositories - gostls13.git/commit
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 20:24:01 +0000 (20:24 +0000)
commitbd49b3d580731d8f391e40fb9e2f17301651cede
treeec7b806a29d79be5924894aa58f8c743d0354c4e
parent796e4bdc6b3edef2d838ddc3c4d35aee3f8e89cc
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>
src/net/splice_test.go