s3:smbd: let default_sys_recvfile() and sys_recvfile() cope with non-blocking sockets.
commitb8ae6f8f57271fd4b8c57d5b800930b8558c1b4a
authorJeremy Allison <jra@samba.org>
Tue, 15 Apr 2014 19:43:06 +0000 (15 12:43 -0700)
committerMichael Adam <obnox@samba.org>
Sat, 24 May 2014 11:48:14 +0000 (24 13:48 +0200)
tree2e639c9a2da72df3b8fa024919f8d2b1bcdae5e6
parentec4496b823a7af6587ce6054452f7ef3bbb66084
s3:smbd: let default_sys_recvfile() and sys_recvfile() cope with non-blocking sockets.

default_sys_recvfile() and splice() recvfile were not
written to cope with non-blocking sockets.

When either the socket read() or splice() return
-1 with errno EWOULDBLOCK or EAGAIN, if no bytes have been
processed yet, return -1 and let the caller set
blocking and retry. If bytes have been processed,
just return them as a short read and let the
caller retry with the remaining needed reads.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/lib/recvfile.c