Skip to content

Commit dbc5a79

Browse files
committed
Networking (Linux): don't generate SIGPIPE
1 parent 5f43f63 commit dbc5a79

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/common/networking/networking_linux.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,17 @@ static const char* tryTcpFastOpen(FFNetworkingState* state)
5757
#ifndef __APPLE__
5858
FF_DEBUG("Using sendto() + MSG_FASTOPEN to send %u bytes of data", state->command.length);
5959
ssize_t sent = sendto(state->sockfd,
60-
state->command.chars,
61-
state->command.length,
60+
state->command.chars,
61+
state->command.length,
6262
#ifdef MSG_FASTOPEN
63-
MSG_FASTOPEN |
63+
MSG_FASTOPEN |
6464
#endif
65-
MSG_DONTWAIT,
66-
state->addr->ai_addr,
67-
state->addr->ai_addrlen);
65+
#ifdef MSG_NOSIGNAL
66+
MSG_NOSIGNAL |
67+
#endif
68+
MSG_DONTWAIT,
69+
state->addr->ai_addr,
70+
state->addr->ai_addrlen);
6871
#else
6972
if (fcntl(state->sockfd, F_SETFL, O_NONBLOCK) == -1) {
7073
FF_DEBUG("fcntl(F_SETFL) failed: %s", strerror(errno));

0 commit comments

Comments
 (0)