diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-09-25 11:16:30 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:13 -0500 |
commit | 5abd7f8f5f04b2c2a66e97974049fc65b11df9e0 (patch) | |
tree | 2c0cbdfef9bcbe5bc6aa9b1baac61ec746e9ec6d /source4 | |
parent | 30381686c4874e4f9602a977a31399e49350e597 (diff) | |
download | samba-5abd7f8f5f04b2c2a66e97974049fc65b11df9e0.tar.gz samba-5abd7f8f5f04b2c2a66e97974049fc65b11df9e0.tar.bz2 samba-5abd7f8f5f04b2c2a66e97974049fc65b11df9e0.zip |
r2622: to implement the SOCKET_FLAG_BLOCK option in the socket library we
need to add MSG_WAITALL to the recv() flags. This is needed by the
current server code or sometimes it will fail with a receive error.
(This used to be commit 4cb11fb77acf74ab53bf5782a114151965c558f0)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/socket/socket_ipv4.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/lib/socket/socket_ipv4.c b/source4/lib/socket/socket_ipv4.c index 151c49518f..67f1e99d17 100644 --- a/source4/lib/socket/socket_ipv4.c +++ b/source4/lib/socket/socket_ipv4.c @@ -204,6 +204,10 @@ static NTSTATUS ipv4_tcp_recv(struct socket_context *sock, TALLOC_CTX *mem_ctx, flgs |= MSG_DONTWAIT; } + if (flags & SOCKET_FLAG_BLOCK) { + flgs |= MSG_WAITALL; + } + gotlen = recv(sock->fd, buf, wantlen, flgs); if (gotlen == 0) { talloc_free(buf); |