aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/worldserver/RemoteAccess/RASocket.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp
index 75c95d5ea98..95fdad9ad44 100644
--- a/src/server/worldserver/RemoteAccess/RASocket.cpp
+++ b/src/server/worldserver/RemoteAccess/RASocket.cpp
@@ -65,7 +65,13 @@ int RASocket::handle_close(ACE_HANDLE, ACE_Reactor_Mask)
int RASocket::send(const std::string& line)
{
- return size_t(peer().send(line.c_str(), line.length())) == line.length() ? 0 : -1;
+#ifdef MSG_NOSIGNAL
+ ssize_t n = peer().send(line.c_str(), line.length(), MSG_NOSIGNAL);
+#else
+ ssize_t n = peer().send(line.c_str(), line.length());
+#endif // MSG_NOSIGNAL
+
+ return n == line.length() ? 0 : -1;
}
int RASocket::recv_line(ACE_Message_Block& buffer)
@@ -160,7 +166,7 @@ int RASocket::process_command(const std::string& command)
break;
}
- if (size_t(peer().send(mb->rd_ptr(), mb->length())) != mb->length())
+ if (send(std::string(mb->rd_ptr(), mb->length())) == -1)
{
mb->release();
return -1;
@@ -356,8 +362,7 @@ int RASocket::svc(void)
for (;;)
{
// show prompt
- const char* tc_prompt = "TC> ";
- if (size_t(peer().send(tc_prompt, strlen(tc_prompt))) != strlen(tc_prompt))
+ if (send("TC> ") == -1)
return -1;
std::string line;