Oh crap, got SIGPIPE. Add MSG_NOSIGNAL

sync-io-test
Vitaliy Filippov 2020-06-02 11:41:08 +03:00
parent c3fe9ad0d1
commit af5cd45071
1 changed files with 1 additions and 1 deletions

View File

@ -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;