aboutsummaryrefslogtreecommitdiff
path: root/src/server/worldserver
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/worldserver
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/worldserver')
-rw-r--r--src/server/worldserver/RemoteAccess/RASocket.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp
index b939f267233..ee05e83ad4d 100644
--- a/src/server/worldserver/RemoteAccess/RASocket.cpp
+++ b/src/server/worldserver/RemoteAccess/RASocket.cpp
@@ -336,7 +336,12 @@ int RASocket::subnegotiate()
//! Just send back end of subnegotiation packet
uint8 const reply[2] = {0xFF, 0xF0};
+
+#ifdef MSG_NOSIGNAL
+ return int(peer().send(reply, 2, MSG_NOSIGNAL));
+#else
return int(peer().send(reply, 2));
+#endif // MSG_NOSIGNAL
}
int RASocket::svc(void)