s3: smbd: Fix Solaris sendfile() for SMB2. Ensure we don't spin on EAGAIN.
authorJeremy Allison <jra@samba.org>
Wed, 18 Jul 2018 22:29:37 +0000 (15:29 -0700)
committerVolker Lendecke <vl@samba.org>
Fri, 20 Jul 2018 10:25:16 +0000 (12:25 +0200)
commit16a587075c8c62c1160869358ca56a133e90247a
tree1b4e1a6a523be645f92e96e586f5adbf045ff264
parent809967b3eab7a1b48c186517701538ca93536246
s3: smbd: Fix Solaris 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>
source3/lib/sendfile.c