Core/Sockets: Always try to send MSG_NOSIGNAL in peer().send()

Fixes RASocket::authenticate crash

"MSG_NOSIGNAL:
If you send() to a remote host which is no longer recv()ing, you'll typically get the signal SIGPIPE. Adding this flag prevents that signal from being raised."

Closes #5040
Thanks to @derex for the hint
This commit is contained in:
Nay
2013-02-11 02:59:07 +00:00
parent 2cf8cdaa80
commit 42e660e2a2
3 changed files with 11 additions and 2 deletions
+2 -2
View File
@@ -372,9 +372,9 @@ int WorldSocket::handle_output_queue (GuardType& g)
const size_t send_len = mblk->length();
#ifdef MSG_NOSIGNAL
ssize_t n = peer().send (mblk->rd_ptr(), send_len, MSG_NOSIGNAL);
ssize_t n = peer().send(mblk->rd_ptr(), send_len, MSG_NOSIGNAL);
#else
ssize_t n = peer().send (mblk->rd_ptr(), send_len);
ssize_t n = peer().send(mblk->rd_ptr(), send_len);
#endif // MSG_NOSIGNAL
if (n == 0)