From af5cd45071b84d337d0328ba7e8cfa6977edf2c2 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Tue, 2 Jun 2020 11:41:08 +0300 Subject: [PATCH] Oh crap, got SIGPIPE. Add MSG_NOSIGNAL --- http_client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http_client.cpp b/http_client.cpp index 517a649e..a1c421ba 100644 --- a/http_client.cpp +++ b/http_client.cpp @@ -323,7 +323,7 @@ again: send_iov = (iovec){ .iov_base = (void*)(request.c_str()+sent), .iov_len = request.size()-sent }; send_msg.msg_iov = &send_iov; send_msg.msg_iovlen = 1; - res = sendmsg(peer_fd, &send_msg, 0); + res = sendmsg(peer_fd, &send_msg, MSG_NOSIGNAL); if (res < 0) { res = -errno;