Ignore SIGPIPE signal receiving data to avoid crash

Co-Authored-By: unknownbrackets <checkins@unknownbrackets.org>
This commit is contained in:
Benito Palacios Sanchezandunknownbrackets committed 2018-10-16 22:57:58 +02:00
1 parent 25230a14f2
commit e221187561
1 file changed
+1 -1
+1 -1
View File
@@ -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;