Skip to content

Commit

Permalink
Merge pull request #1794 from klemensn/per-socket-keepidle
Browse files Browse the repository at this point in the history
No per-socket TCP keepidle on OpenBSD
  • Loading branch information
mikebrady authored Jan 29, 2024
2 parents 6c6d284 + dc23527 commit e6f7a45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
#define COMPILE_FOR_FREEBSD 1
#endif

#if defined(__OpenBSD__)
#define COMPILE_FOR_OPENBSD 1
#endif

// struct sockaddr_in6 is bigger than struct sockaddr. derp
#ifdef AF_INET6
#define SOCKADDR struct sockaddr_storage
Expand Down
2 changes: 2 additions & 0 deletions rtsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -5623,6 +5623,7 @@ void *rtsp_listen_loop(__attribute((unused)) void *arg) {
#define KEEP_ALIVE_OR_IDLE_OPTION TCP_KEEPIDLE
#endif

#ifndef COMPILE_FOR_OPENBSD
if (setsockopt(conn->fd, SOL_OPTION, KEEP_ALIVE_OR_IDLE_OPTION,
(void *)&keepAliveIdleTime, sizeof(keepAliveIdleTime))) {
debug(1, "can't set the keepidle wait time");
Expand All @@ -5636,6 +5637,7 @@ void *rtsp_listen_loop(__attribute((unused)) void *arg) {
sizeof(keepAliveInterval))) {
debug(1, "can't set the keepidle missing count interval");
};
#endif

// initialise the connection info
void *client_addr = NULL, *self_addr = NULL;
Expand Down

0 comments on commit e6f7a45

Please sign in to comment.