aboutsummaryrefslogtreecommitdiff
path: root/src/server/authserver
diff options
context:
space:
mode:
authorNay <dnpd.dd@gmail.com>2013-02-11 02:59:07 +0000
committerNay <dnpd.dd@gmail.com>2013-02-11 02:59:37 +0000
commit42e660e2a2f6642141a138760bbfefd78a6fb501 (patch)
tree5f4a55abaebc3c5e4f97a4956ef010ff2ba81583 /src/server/authserver
parent2cf8cdaa800b032eba484811f65cf619af07e80f (diff)
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
Diffstat (limited to 'src/server/authserver')
-rw-r--r--src/server/authserver/Server/RealmSocket.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server/authserver/Server/RealmSocket.cpp b/src/server/authserver/Server/RealmSocket.cpp
index e67af783d5f..2e64321d8a1 100644
--- a/src/server/authserver/Server/RealmSocket.cpp
+++ b/src/server/authserver/Server/RealmSocket.cpp
@@ -138,7 +138,11 @@ ssize_t RealmSocket::noblk_send(ACE_Message_Block &message_block)
return -1;
// Try to send the message directly.
+#ifdef MSG_NOSIGNAL
ssize_t n = peer().send(message_block.rd_ptr(), len, MSG_NOSIGNAL);
+#else
+ ssize_t n = peer().send(message_block.rd_ptr(), len);
+#endif // MSG_NOSIGNAL
if (n < 0)
{