From 5abd7f8f5f04b2c2a66e97974049fc65b11df9e0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 25 Sep 2004 11:16:30 +0000 Subject: 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) --- source4/lib/socket/socket_ipv4.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/lib/socket') 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); -- cgit