s3: smbd: Fix HPUX sendfile() for SMB2. Ensure we don't spin on EAGAIN.
commitadb7d6a1f465dcf39e68cdaa3980a0bf65ca35b4
authorJeremy Allison <jra@samba.org>
Wed, 18 Jul 2018 22:36:47 +0000 (18 15:36 -0700)
committerKarolin Seeger <kseeger@samba.org>
Sat, 28 Jul 2018 04:16:16 +0000 (28 06:16 +0200)
treeb6537eeddd58145233486abc1b6227b35b00fc2c
parent2c58fbdec214d33561e1d1ddad5724d36cfc07f2
s3: smbd: Fix HPUX 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>
(cherry picked from commit d222caa449d9c00bb2dd9da6c79ea509960d47c6)
source3/lib/sendfile.c