s3: smbd: Fix AIX sendfile() for SMB2. Ensure we don't spin on EAGAIN.
commita431bdf08fdad479471bbb2ab0cf86c595260d23
authorJeremy Allison <jra@samba.org>
Wed, 18 Jul 2018 22:49:29 +0000 (18 15:49 -0700)
committerKarolin Seeger <kseeger@samba.org>
Sat, 28 Jul 2018 08:57:39 +0000 (28 10:57 +0200)
treeb116acdb53c0d1986add774e28b21200c2bfb87e
parent7bf15686b60c35c853ae469906baa7d5ed51e4b7
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

(cherry picked from commit 582ce5d6b599516d6d8d619529a2aa809139a175)

Autobuild-User(v4-7-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-7-test): Sat Jul 28 10:57:39 CEST 2018 on sn-devel-144
source3/lib/sendfile.c