fix compilation for openbsd
This commit is contained in:
parent
88e42d3b9f
commit
d3476ce716
2 changed files with 159 additions and 1 deletions
|
@ -22,7 +22,7 @@ pub fn configure_socket(socket: SockRef, so_mark: &Option<u32>) -> Result<(), an
|
|||
.set_nodelay(true)
|
||||
.with_context(|| format!("cannot set no_delay on socket: {:?}", io::Error::last_os_error()))?;
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
#[cfg(not(any(target_os = "windows", target_os = "openbsd")))]
|
||||
let tcp_keepalive = TcpKeepalive::new()
|
||||
.with_time(Duration::from_secs(60))
|
||||
.with_interval(Duration::from_secs(10))
|
||||
|
@ -33,6 +33,9 @@ pub fn configure_socket(socket: SockRef, so_mark: &Option<u32>) -> Result<(), an
|
|||
.with_time(Duration::from_secs(60))
|
||||
.with_interval(Duration::from_secs(10));
|
||||
|
||||
#[cfg(target_os = "openbsd")]
|
||||
let tcp_keepalive = TcpKeepalive::new().with_time(Duration::from_secs(60));
|
||||
|
||||
socket
|
||||
.set_tcp_keepalive(&tcp_keepalive)
|
||||
.with_context(|| format!("cannot set tcp_keepalive on socket: {:?}", io::Error::last_os_error()))?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue