Skip to content

Commit acb424a

Browse files
committed
Fix read timeout handling
1 parent eaab86f commit acb424a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

postgres/src/priv_io.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,7 @@ impl MessageStream {
118118
}
119119

120120
fn set_read_timeout(&self, timeout: Option<Duration>) -> io::Result<()> {
121-
// self.stream.get_ref().get_ref().0.set_read_timeout(timeout)
122-
let s = unsafe {
123-
::std::net::TcpStream::from_raw_fd(self.stream.get_ref().get_ref().0.as_raw_fd())
124-
};
125-
let r = s.set_read_timeout(timeout);
126-
::std::mem::forget(s);
127-
r
121+
self.stream.get_ref().get_ref().0.set_read_timeout(timeout)
128122
}
129123

130124
fn set_nonblocking(&self, nonblock: bool) -> io::Result<()> {

0 commit comments

Comments
 (0)