]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[MEDIUM] splice: add hints to support older buggy kernels
authorWilly Tarreau <w@1wt.eu>
Sun, 25 Jan 2009 10:11:32 +0000 (11:11 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 25 Jan 2009 10:11:32 +0000 (11:11 +0100)
commit98b306be6599cc1caccb5698ae5fdadfebbb9313
tree0c6d1ab405c3ba01a27aeb981ae3687d6e93b54d
parentafb4876778468106dc4766ab6101f1d25d60ab5a
[MEDIUM] splice: add hints to support older buggy kernels

Kernels before 2.6.27.13 would have splice() return EAGAIN on shutdown.
By adding a few tricks, we can deal with the situation. If splice()
returns EAGAIN and the pipe is empty, then fallback to recv() which
will be able to check if it's an end of connection or not.

The advantage of this method is that it remains transparent for good
kernels since there is no reason that epoll() will return EPOLLIN
without anything to read, and even if it would happen, the recv()
overhead on this check is minimal.
src/stream_sock.c