diff options
| author | Steven Fackler <[email protected]> | 2015-08-08 12:24:21 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2015-08-08 12:25:16 -0700 |
| commit | 69cbd145407288e3b22b7336fe6a679546b4b2fd (patch) | |
| tree | b0cdfc7046f757be87e983af9a3b0333aff485eb | |
| parent | Merge pull request #243 from manuels/master (diff) | |
| download | rust-openssl-69cbd145407288e3b22b7336fe6a679546b4b2fd.tar.xz rust-openssl-69cbd145407288e3b22b7336fe6a679546b4b2fd.zip | |
Handle WantWrite and WantRead errors
| -rw-r--r-- | openssl/src/ssl/mod.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index 6cbd6f88..9781efe5 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -1046,6 +1046,14 @@ 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")) + } err => panic!("unexpected error {:?} with ret {}", err, ret), } } |