Skip to content

Commit 9139282

Browse files
committed
Don't explicity disable keepalive
We want to use the OS default normally
1 parent fd53c56 commit 9139282

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

postgres/src/priv_io.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ fn open_socket(params: &ConnectParams) -> Result<Socket> {
186186
SocketAddr::V6(_) => Domain::ipv6(),
187187
};
188188
let socket = Socket::new(domain, Type::stream(), None)?;
189-
socket.set_keepalive(params.keepalive())?;
189+
if let Some(keepalive) = params.keepalive() {
190+
socket.set_keepalive(Some(keepalive))?;
191+
}
190192
let addr = SockAddr::from(addr);
191193
let r = match params.connect_timeout() {
192194
Some(timeout) => socket.connect_timeout(&addr, timeout),

0 commit comments

Comments
 (0)