From dbc5a7961e5e8501a07d3c20748653d23e17067b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Mon, 17 Mar 2025 23:13:44 +0800 Subject: [PATCH] Networking (Linux): don't generate SIGPIPE --- src/common/networking/networking_linux.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/common/networking/networking_linux.c b/src/common/networking/networking_linux.c index caf91f668..4c3dc3435 100644 --- a/src/common/networking/networking_linux.c +++ b/src/common/networking/networking_linux.c @@ -57,14 +57,17 @@ static const char* tryTcpFastOpen(FFNetworkingState* state) #ifndef __APPLE__ FF_DEBUG("Using sendto() + MSG_FASTOPEN to send %u bytes of data", state->command.length); ssize_t sent = sendto(state->sockfd, - state->command.chars, - state->command.length, + state->command.chars, + state->command.length, #ifdef MSG_FASTOPEN - MSG_FASTOPEN | + MSG_FASTOPEN | #endif - MSG_DONTWAIT, - state->addr->ai_addr, - state->addr->ai_addrlen); + #ifdef MSG_NOSIGNAL + MSG_NOSIGNAL | + #endif + MSG_DONTWAIT, + state->addr->ai_addr, + state->addr->ai_addrlen); #else if (fcntl(state->sockfd, F_SETFL, O_NONBLOCK) == -1) { FF_DEBUG("fcntl(F_SETFL) failed: %s", strerror(errno));