From b8b5586d6a12a37a663a4b0ab3f5ac9cd4416198 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Thu, 3 Mar 2016 20:24:27 +0100 Subject: [PATCH] Fixed #134: use MSG_NOSIGNAL to avoid SIGPIPE. --- src/vmime/platforms/posix/posixSocket.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vmime/platforms/posix/posixSocket.cpp b/src/vmime/platforms/posix/posixSocket.cpp index 7272eed1..d129a8f0 100644 --- a/src/vmime/platforms/posix/posixSocket.cpp +++ b/src/vmime/platforms/posix/posixSocket.cpp @@ -723,7 +723,7 @@ void posixSocket::sendRaw(const byte_t* buffer, const size_t count) while (size > 0) { - const ssize_t ret = ::send(m_desc, buffer, size, 0); + const ssize_t ret = ::send(m_desc, buffer, size, MSG_NOSIGNAL); if (ret <= 0) { @@ -749,7 +749,7 @@ size_t posixSocket::sendRawNonBlocking(const byte_t* buffer, const size_t count) { m_status &= ~STATUS_WOULDBLOCK; - const ssize_t ret = ::send(m_desc, buffer, count, 0); + const ssize_t ret = ::send(m_desc, buffer, count, MSG_NOSIGNAL); if (ret <= 0) {