Skip to content

Commit 4c2ded1

Browse files
authored
Merge pull request #1215 from sfackler/wsl1
Only call set_tcp_user_timeout when enabled
2 parents 1e1f6bf + c867352 commit 4c2ded1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tokio-postgres/src/connect_socket.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ pub(crate) async fn connect_socket(
2727
stream.set_nodelay(true).map_err(Error::connect)?;
2828

2929
let sock_ref = SockRef::from(&stream);
30+
3031
#[cfg(target_os = "linux")]
31-
{
32+
if let Some(tcp_user_timeout) = tcp_user_timeout {
3233
sock_ref
33-
.set_tcp_user_timeout(tcp_user_timeout)
34+
.set_tcp_user_timeout(Some(tcp_user_timeout))
3435
.map_err(Error::connect)?;
3536
}
3637

0 commit comments

Comments
 (0)