Permalink
Browse files

Ignore SIGPIPE signal receiving data to avoid crash

Co-Authored-By: unknownbrackets <checkins@unknownbrackets.org>
  • Loading branch information...
pleonex and unknownbrackets committed Oct 16, 2018
1 parent 25230a1 commit e221187561107d5c108e22fee03eedf2f3b908d2
Showing with 1 addition and 1 deletion.
  1. +1 −1 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;

0 comments on commit e221187

Please sign in to comment.