]> Cypherpunks repositories - gostls13.git/commit
internal/poll: disable splice on old linux versions
authorBen Burkert <ben@benburkert.com>
Tue, 22 May 2018 02:28:19 +0000 (19:28 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 23 May 2018 01:45:00 +0000 (01:45 +0000)
commit92bdfab795a1245d8b81a6e841d5e5aa52f3a790
treee55617aed5b678258acb87e150c46889e49a5346
parent132900982c2b28470559afcdc43f517cdf285e9c
internal/poll: disable splice on old linux versions

The splice syscall is buggy prior to linux 2.6.29. Instead of returning
0 when reading a closed socket, it returns EAGAIN.  While it is possible
to detect this (HAProxy falls back to recv), it is simpiler to avoid
using splice all together. the "fcntl(fd, F_GETPIPE_SZ)" syscall is used
detect buggy versions of splice as the syscall returns EINVAL on
versions prior to 2.6.35.

Fixes #25486

Change-Id: I860c029f13de2b09e95a7ba39b76ac7fca91a195
Reviewed-on: https://go-review.googlesource.com/113999
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/internal/poll/splice_linux.go