From 485a82e6138d43169c89cf93d5789e4d6c912204 Mon Sep 17 00:00:00 2001 From: Hugo Santos Date: Thu, 5 Apr 2007 16:09:06 +0000 Subject: [PATCH] as per the Open Group Specification, MSG_TRUNC should be set in flags whenever the packet is truncated git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20583 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/network/stack/net_socket.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/add-ons/kernel/network/stack/net_socket.cpp b/src/add-ons/kernel/network/stack/net_socket.cpp index d04e135e7c..7c917b1992 100644 --- a/src/add-ons/kernel/network/stack/net_socket.cpp +++ b/src/add-ons/kernel/network/stack/net_socket.cpp @@ -823,14 +823,11 @@ socket_receive(net_socket *socket, msghdr *header, void *data, size_t length, gNetBufferModule.free(buffer); if (bytesCopied < bytesReceived) { - if (flags & MSG_TRUNC) { - if (header) - header->msg_flags = MSG_TRUNC; + if (header) + header->msg_flags = MSG_TRUNC; + if (flags & MSG_TRUNC) return bytesReceived; - } - - return ENOBUFS; } return bytesCopied;