summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormekolat <mekolat@users.noreply.github.com>2015-07-29 11:41:36 -0400
committermekolat <mekolat@users.noreply.github.com>2015-07-29 15:44:30 -0400
commit52cc780c90d31cd41b89494ea2770c4f9ed47247 (patch)
tree6aa3100a7dc69515c37339ec40cd1539e3136864
parent98e908eec29e9b5b02fb7d7bf29886dfeb98c7dd (diff)
downloadtmwa-52cc780c90d31cd41b89494ea2770c4f9ed47247.tar.gz
tmwa-52cc780c90d31cd41b89494ea2770c4f9ed47247.tar.bz2
tmwa-52cc780c90d31cd41b89494ea2770c4f9ed47247.tar.xz
tmwa-52cc780c90d31cd41b89494ea2770c4f9ed47247.zip
replace socket write with send with MSG_NOSIGNAL
-rw-r--r--src/io/fd.cpp4
-rw-r--r--src/io/fd.hpp1
-rw-r--r--src/net/socket.cpp2
3 files changed, 6 insertions, 1 deletions
diff --git a/src/io/fd.cpp b/src/io/fd.cpp
index bb0bbd5..43bf7c4 100644
--- a/src/io/fd.cpp
+++ b/src/io/fd.cpp
@@ -75,6 +75,10 @@ namespace io
{
return ::write(fd, buf, count);
}
+ ssize_t FD::send(const void *buf, size_t count, int flags)
+ {
+ return ::send(fd, buf, count, flags);
+ }
ssize_t FD::pread(void *buf, size_t count, off_t offset)
{
return ::pread(fd, buf, count, offset);
diff --git a/src/io/fd.hpp b/src/io/fd.hpp
index 03a8b44..00aad8f 100644
--- a/src/io/fd.hpp
+++ b/src/io/fd.hpp
@@ -77,6 +77,7 @@ namespace io
ssize_t read(void *buf, size_t count);
ssize_t write(const void *buf, size_t count);
+ ssize_t send(const void *buf, size_t count, int flags);
ssize_t pread(void *buf, size_t count, off_t offset);
ssize_t pwrite(const void *buf, size_t count, off_t offset);
ssize_t readv(const struct iovec *iov, int iovcnt);
diff --git a/src/net/socket.cpp b/src/net/socket.cpp
index fce45fb..7f71310 100644
--- a/src/net/socket.cpp
+++ b/src/net/socket.cpp
@@ -153,7 +153,7 @@ void recv_to_fifo(Session *s)
static
void send_from_fifo(Session *s)
{
- ssize_t len = s->fd.write(&s->wdata[0], s->wdata_size);
+ ssize_t len = s->fd.send(&s->wdata[0], s->wdata_size, MSG_NOSIGNAL);
if (len > 0)
{