Skip to content

Commit 700ccad

Browse files
Niklas HallqvistThomasdezeeuw
authored andcommitted
OpenBSD does not have per-socket keepalive parameters.
1 parent 4c56bb9 commit 700ccad

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/lib.rs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,10 +380,16 @@ impl<'a> DerefMut for MaybeUninitSlice<'a> {
380380
/// See [`Socket::set_tcp_keepalive`].
381381
#[derive(Debug, Clone)]
382382
pub struct TcpKeepalive {
383+
#[cfg_attr(target_os = "openbsd", allow(dead_code))]
383384
time: Option<Duration>,
384-
#[cfg(not(any(target_os = "redox", target_os = "solaris")))]
385+
#[cfg(not(any(target_os = "openbsd", target_os = "redox", target_os = "solaris")))]
385386
interval: Option<Duration>,
386-
#[cfg(not(any(target_os = "redox", target_os = "solaris", target_os = "windows")))]
387+
#[cfg(not(any(
388+
target_os = "openbsd",
389+
target_os = "redox",
390+
target_os = "solaris",
391+
target_os = "windows"
392+
)))]
387393
retries: Option<u32>,
388394
}
389395

@@ -392,9 +398,14 @@ impl TcpKeepalive {
392398
pub const fn new() -> TcpKeepalive {
393399
TcpKeepalive {
394400
time: None,
395-
#[cfg(not(any(target_os = "redox", target_os = "solaris")))]
401+
#[cfg(not(any(target_os = "openbsd", target_os = "redox", target_os = "solaris")))]
396402
interval: None,
397-
#[cfg(not(any(target_os = "redox", target_os = "solaris", target_os = "windows")))]
403+
#[cfg(not(any(
404+
target_os = "openbsd",
405+
target_os = "redox",
406+
target_os = "solaris",
407+
target_os = "windows"
408+
)))]
398409
retries: None,
399410
}
400411
}

0 commit comments

Comments
 (0)