s3: smbd: Fix AIX sendfile() for SMB2. Ensure we don't spin on EAGAIN.
commit582ce5d6b599516d6d8d619529a2aa809139a175
authorJeremy Allison <jra@samba.org>
Wed, 18 Jul 2018 22:49:29 +0000 (18 15:49 -0700)
committerVolker Lendecke <vl@samba.org>
Fri, 20 Jul 2018 13:14:24 +0000 (20 15:14 +0200)
tree85984e30016d3b885dede2ea2eed6e9a9d6e4a29
parent456e520a3be7e4b54f1f144324c3671b8f6e35ea
s3: smbd: Fix AIX sendfile() for SMB2. Ensure we don't spin on EAGAIN.

For SMB2 the socket is set non-blocking. Ensure sendfile()
calls complete if they return EAGAIN by saving the socket state,
setting it blocking, doing the sendfile until completion and then
restoring the socket state.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13537

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jul 20 15:14:24 CEST 2018 on sn-devel-144
source3/lib/sendfile.c