Commit 5287f8e1 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

network: use send(MSG_NOSIGNAL) in net_Write()

This ensures that SIGPIPE is not emitted if the connection is closed by
the other end. Using send() is fine given that all net_Write(),
net_vaPrintf() and net_Printf() call sites use (only) sockets.
parent eb37a5b7
......@@ -354,7 +354,7 @@ error:
#undef net_Write
/**
* Writes data to a file descriptor.
* Writes data to a socket.
* This blocks until all data is written or an error occurs.
*
* This function is a cancellation point.
......@@ -407,11 +407,7 @@ ssize_t net_Write( vlc_object_t *p_this, int fd,
}
}
#ifdef _WIN32
ssize_t val = send (fd, p_data, i_data, 0);
#else
ssize_t val = write (fd, p_data, i_data);
#endif
ssize_t val = send (fd, p_data, i_data, MSG_NOSIGNAL);
if (val == -1)
{
if (errno == EINTR)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment