freebsd-ports/www/iridium/files/patch-net_socket_tcp__socket__posix.cc
Robert Nagy 9c709a1d6b www/iridium: update to 2023.04.112
Approved by:	rene (mentor)
Differential Revision:	https://reviews.freebsd.org/D39769
2023-04-23 20:24:00 +02:00

20 lines
731 B
C++

--- net/socket/tcp_socket_posix.cc.orig 2023-04-22 17:45:15 UTC
+++ net/socket/tcp_socket_posix.cc
@@ -99,6 +99,17 @@ bool SetTCPKeepAlive(int fd, bool enable, int delay) {
PLOG(ERROR) << "Failed to set TCP_KEEPALIVE on fd: " << fd;
return false;
}
+#elif BUILDFLAG(IS_FREEBSD)
+ // Set seconds until first TCP keep alive.
+ if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &delay, sizeof(delay))) {
+ PLOG(ERROR) << "Failed to set TCP_KEEPIDLE on fd: " << fd;
+ return false;
+ }
+ // Set seconds between TCP keep alives.
+ if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &delay, sizeof(delay))) {
+ PLOG(ERROR) << "Failed to set TCP_KEEPINTVL on fd: " << fd;
+ return false;
+ }
#endif
}