Skip to content

Commit

Permalink
Merge pull request #1215 from sfackler/wsl1
Browse files Browse the repository at this point in the history
Only call set_tcp_user_timeout when enabled
  • Loading branch information
sfackler authored Feb 14, 2025
2 parents 1e1f6bf + c867352 commit 4c2ded1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tokio-postgres/src/connect_socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ pub(crate) async fn connect_socket(
stream.set_nodelay(true).map_err(Error::connect)?;

let sock_ref = SockRef::from(&stream);

#[cfg(target_os = "linux")]
{
if let Some(tcp_user_timeout) = tcp_user_timeout {
sock_ref
.set_tcp_user_timeout(tcp_user_timeout)
.set_tcp_user_timeout(Some(tcp_user_timeout))
.map_err(Error::connect)?;
}

Expand Down

0 comments on commit 4c2ded1

Please sign in to comment.