diff options
author | Florent Le Coz <louiz@louiz.org> | 2014-02-20 00:00:05 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2014-02-20 00:00:05 +0100 |
commit | e390b79a12a150b13570f7f0b19f50e1b0ead3a0 (patch) | |
tree | e456f8e593c91cd88c5f2b133920bd509a8a44e2 | |
parent | 16be9af3fcd23fa8590692cbe84af20cfe6a60b2 (diff) | |
download | biboumi-e390b79a12a150b13570f7f0b19f50e1b0ead3a0.tar.gz biboumi-e390b79a12a150b13570f7f0b19f50e1b0ead3a0.tar.bz2 biboumi-e390b79a12a150b13570f7f0b19f50e1b0ead3a0.tar.xz biboumi-e390b79a12a150b13570f7f0b19f50e1b0ead3a0.zip |
Do not receive SIGPIPE when send() is called on a closed socket
The error is handled using the return value
-rw-r--r-- | src/network/socket_handler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/socket_handler.cpp b/src/network/socket_handler.cpp index 580bba6..7faa9fd 100644 --- a/src/network/socket_handler.cpp +++ b/src/network/socket_handler.cpp @@ -96,7 +96,7 @@ void SocketHandler::on_recv(const size_t nb) void SocketHandler::on_send() { - const ssize_t res = ::send(this->socket, this->out_buf.data(), this->out_buf.size(), 0); + const ssize_t res = ::send(this->socket, this->out_buf.data(), this->out_buf.size(), MSG_NOSIGNAL); if (res == -1) { log_error("send failed: " << strerror(errno)); |