summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-01-09 22:47:11 +0000
committergepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-01-09 22:47:11 +0000
commit77c0db2f2cf420d70ce9c00e46d72d3506f5c9df (patch)
treecd69f60cfaff11fbdeb98dc579bf2bb4db98316d /src
parent6f0f01549234d6427486c23ffa06129626f53438 (diff)
downloadhercules-77c0db2f2cf420d70ce9c00e46d72d3506f5c9df.tar.gz
hercules-77c0db2f2cf420d70ce9c00e46d72d3506f5c9df.tar.bz2
hercules-77c0db2f2cf420d70ce9c00e46d72d3506f5c9df.tar.xz
hercules-77c0db2f2cf420d70ce9c00e46d72d3506f5c9df.zip
Sending to a broken socket will no longer cause SIGPIPE signal to be sent back on most *nix systems (those supporting MSG_NOSIGNAL flag) (bugreport:5224)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15415 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/common/socket.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/common/socket.c b/src/common/socket.c
index 4f7afd8fd..e7f1034ae 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -194,6 +194,10 @@ int sSocket(int af, int type, int protocol)
#endif
/////////////////////////////////////////////////////////////////////
+#ifndef MSG_NOSIGNAL
+ #define MSG_NOSIGNAL 0
+#endif
+
fd_set readfds;
int fd_max;
time_t last_tick;
@@ -340,7 +344,7 @@ int send_from_fifo(int fd)
if( session[fd]->wdata_size == 0 )
return 0; // nothing to send
- len = sSend(fd, (const char *) session[fd]->wdata, (int)session[fd]->wdata_size, 0);
+ len = sSend(fd, (const char *) session[fd]->wdata, (int)session[fd]->wdata_size, MSG_NOSIGNAL);
if( len == SOCKET_ERROR )
{//An exception has occured