Grab errno for directstream want errors

This commit is contained in:
Steven Fackler 2015-08-10 22:29:34 -04:00
parent 69cbd14540
commit df32e53afa
1 changed files with 2 additions and 7 deletions

View File

@ -1046,13 +1046,8 @@ impl<S> DirectStream<S> {
err
}
}
LibSslError::ErrorWantWrite => {
SslError::StreamError(io::Error::new(io::ErrorKind::TimedOut,
"socket write timed out"))
}
LibSslError::ErrorWantRead => {
SslError::StreamError(io::Error::new(io::ErrorKind::TimedOut,
"socket read timed out"))
LibSslError::ErrorWantWrite | LibSslError::ErrorWantRead => {
SslError::StreamError(io::Error::last_os_error())
}
err => panic!("unexpected error {:?} with ret {}", err, ret),
}