network/stack: Mask off MSG_NOSIGNAL at the top of socket_receive.

Fixes WebKitGTK spinning endlessly and spawning lots of
short-lived worker processes following the addition of
flag checks and EOPNOTSUPP to the various socket modules.

Change-Id: I6d944b4d0235eea9e8a9333645fcb531805f340f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7123
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
Augustin Cavalier 2023-11-22 23:42:51 -05:00 committed by waddlesplash
parent 85a7824e2a
commit da2f2c65b7

View File

@ -1219,6 +1219,10 @@ ssize_t
socket_receive(net_socket* socket, msghdr* header, void* data, size_t length,
int flags)
{
// MSG_NOSIGNAL is only meaningful for send(), not receive(), but it is
// sometimes specified anyway. Mask it off to avoid unnecessary errors.
flags &= ~MSG_NOSIGNAL;
// If the protocol sports read_data_no_buffer() we use it.
if (socket->first_info->read_data_no_buffer != NULL)
return socket_receive_no_buffer(socket, header, data, length, flags);