From e221187561107d5c108e22fee03eedf2f3b908d2 Mon Sep 17 00:00:00 2001 From: Benito Palacios Sanchez Date: Tue, 16 Oct 2018 22:57:58 +0200 Subject: [PATCH] Ignore SIGPIPE signal receiving data to avoid crash Co-Authored-By: unknownbrackets --- ext/native/base/buffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/native/base/buffer.cpp b/ext/native/base/buffer.cpp index 1c9aff81ee..910a19bd7c 100644 --- a/ext/native/base/buffer.cpp +++ b/ext/native/base/buffer.cpp @@ -143,7 +143,7 @@ bool Buffer::FlushToFile(const char *filename) { bool Buffer::FlushSocket(uintptr_t sock) { for (size_t pos = 0, end = data_.size(); pos < end; ) { - int sent = send(sock, &data_[pos], (int)(end - pos), 0); + int sent = send(sock, &data_[pos], (int)(end - pos), MSG_NOSIGNAL); if (sent < 0) { ELOG("FlushSocket failed"); return false;