• Ben Burkert's avatar
    internal/poll: disable splice on old linux versions · 92bdfab7
    Ben Burkert authored
    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/113999Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    92bdfab7
splice_linux.go 5.45 KB