From acb424afa4cbb06433da8720ee1d977e6bf53a4f Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Wed, 20 Sep 2017 08:32:10 -0400 Subject: [PATCH] Fix read timeout handling --- postgres/src/priv_io.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/postgres/src/priv_io.rs b/postgres/src/priv_io.rs index dd272cf0..e407cfd7 100644 --- a/postgres/src/priv_io.rs +++ b/postgres/src/priv_io.rs @@ -118,13 +118,7 @@ impl MessageStream { } fn set_read_timeout(&self, timeout: Option) -> io::Result<()> { - // self.stream.get_ref().get_ref().0.set_read_timeout(timeout) - let s = unsafe { - ::std::net::TcpStream::from_raw_fd(self.stream.get_ref().get_ref().0.as_raw_fd()) - }; - let r = s.set_read_timeout(timeout); - ::std::mem::forget(s); - r + self.stream.get_ref().get_ref().0.set_read_timeout(timeout) } fn set_nonblocking(&self, nonblock: bool) -> io::Result<()> {