Skip to content

Commit 2ebc3cd

Browse files
Niklas HallqvistThomasdezeeuw
authored andcommitted
OpenBSD does not have per-socket keepalive parameters.
1 parent 5b995a0 commit 2ebc3cd

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
@@ -327,10 +327,16 @@ impl<'a> DerefMut for MaybeUninitSlice<'a> {
327327
/// See [`Socket::set_tcp_keepalive`].
328328
#[derive(Debug, Clone)]
329329
pub struct TcpKeepalive {
330+
#[cfg_attr(target_os = "openbsd", allow(dead_code))]
330331
time: Option<Duration>,
331-
#[cfg(not(any(target_os = "redox", target_os = "solaris")))]
332+
#[cfg(not(any(target_os = "openbsd", target_os = "redox", target_os = "solaris")))]
332333
interval: Option<Duration>,
333-
#[cfg(not(any(target_os = "redox", target_os = "solaris", target_os = "windows")))]
334+
#[cfg(not(any(
335+
target_os = "openbsd",
336+
target_os = "redox",
337+
target_os = "solaris",
338+
target_os = "windows"
339+
)))]
334340
retries: Option<u32>,
335341
}
336342

@@ -339,9 +345,14 @@ impl TcpKeepalive {
339345
pub const fn new() -> TcpKeepalive {
340346
TcpKeepalive {
341347
time: None,
342-
#[cfg(not(any(target_os = "redox", target_os = "solaris")))]
348+
#[cfg(not(any(target_os = "openbsd", target_os = "redox", target_os = "solaris")))]
343349
interval: None,
344-
#[cfg(not(any(target_os = "redox", target_os = "solaris", target_os = "windows")))]
350+
#[cfg(not(any(
351+
target_os = "openbsd",
352+
target_os = "redox",
353+
target_os = "solaris",
354+
target_os = "windows"
355+
)))]
345356
retries: None,
346357
}
347358
}

0 commit comments

Comments
 (0)