Author: tridge Date: 2004-10-27 03:45:35 +0000 (Wed, 27 Oct 2004) New Revision: 3279
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/lib/socket&rev=3279&nolog=1 Log: Removed MSG_DONTWAIT flags as many platform don't have it. If a socket is non-blocking then adding MSG_DONTWAIT is pointless (it does nothing), so all we lose is the ability to set non-blocking on a packet-by-packet basis, which is not a very useful thing to have anyway if the socket is blocking then the code already adds MSG_WAITALL, so MSG_DONTWAIT is also not needed in that case. Modified: branches/SAMBA_4_0/source/lib/socket/socket_ipv4.c branches/SAMBA_4_0/source/lib/socket/socket_unix.c Changeset: Modified: branches/SAMBA_4_0/source/lib/socket/socket_ipv4.c =================================================================== --- branches/SAMBA_4_0/source/lib/socket/socket_ipv4.c 2004-10-27 03:15:42 UTC (rev 3278) +++ branches/SAMBA_4_0/source/lib/socket/socket_ipv4.c 2004-10-27 03:45:35 UTC (rev 3279) @@ -183,10 +183,6 @@ flgs |= MSG_PEEK; } - if (!(flags & SOCKET_FLAG_BLOCK)) { - flgs |= MSG_DONTWAIT; - } - if (flags & SOCKET_FLAG_BLOCK) { flgs |= MSG_WAITALL; } @@ -227,16 +223,11 @@ } static NTSTATUS ipv4_tcp_send(struct socket_context *sock, TALLOC_CTX *mem_ctx, - const DATA_BLOB *blob, size_t *sendlen, uint32_t flags) + const DATA_BLOB *blob, size_t *sendlen, uint32_t flags) { ssize_t len; int flgs = 0; - /* TODO: we need to map all flags here */ - if (!(flags & SOCKET_FLAG_BLOCK)) { - flgs |= MSG_DONTWAIT; - } - len = send(sock->fd, blob->data, blob->length, flgs); if (len == -1) { return map_nt_error_from_unix(errno); Modified: branches/SAMBA_4_0/source/lib/socket/socket_unix.c =================================================================== --- branches/SAMBA_4_0/source/lib/socket/socket_unix.c 2004-10-27 03:15:42 UTC (rev 3278) +++ branches/SAMBA_4_0/source/lib/socket/socket_unix.c 2004-10-27 03:45:35 UTC (rev 3279) @@ -172,10 +172,6 @@ flgs |= MSG_PEEK; } - if (!(flags & SOCKET_FLAG_BLOCK)) { - flgs |= MSG_DONTWAIT; - } - if (flags & SOCKET_FLAG_BLOCK) { flgs |= MSG_WAITALL; } @@ -207,11 +203,6 @@ *sendlen = 0; - /* TODO: we need to map all flags here */ - if (!(flags & SOCKET_FLAG_BLOCK)) { - flgs |= MSG_DONTWAIT; - } - len = send(sock->fd, blob->data, blob->length, flgs); if (len == -1) { return unixdom_error(errno);