diff options
| author | Steven Fackler <[email protected]> | 2017-12-25 20:49:30 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-12-25 20:49:30 -0800 |
| commit | ff9fe6fe047231dbb2e8b576b90d68f71c09f5d9 (patch) | |
| tree | 402568904b9a286d9a231c4f719b99a874722857 /openssl/src/ssl/error.rs | |
| parent | Merge pull request #796 from sfackler/assoc-consts (diff) | |
| parent | Fix a bunch of FIXMEs (diff) | |
| download | rust-openssl-ff9fe6fe047231dbb2e8b576b90d68f71c09f5d9.tar.xz rust-openssl-ff9fe6fe047231dbb2e8b576b90d68f71c09f5d9.zip | |
Merge pull request #797 from sfackler/fixmes
Fix a bunch of FIXMEs
Diffstat (limited to 'openssl/src/ssl/error.rs')
| -rw-r--r-- | openssl/src/ssl/error.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/openssl/src/ssl/error.rs b/openssl/src/ssl/error.rs index 48f49979..358a88b0 100644 --- a/openssl/src/ssl/error.rs +++ b/openssl/src/ssl/error.rs @@ -101,11 +101,10 @@ pub enum HandshakeError<S> { SetupFailure(ErrorStack), /// The handshake failed. Failure(MidHandshakeSslStream<S>), - /// The handshake was interrupted midway through. + /// The handshake encountered a `WouldBlock` error midway through. /// /// This error will never be returned for blocking streams. - // FIXME change to WouldBlock - Interrupted(MidHandshakeSslStream<S>), + WouldBlock(MidHandshakeSslStream<S>), } impl<S: Any + fmt::Debug> StdError for HandshakeError<S> { @@ -113,15 +112,14 @@ impl<S: Any + fmt::Debug> StdError for HandshakeError<S> { match *self { HandshakeError::SetupFailure(_) => "stream setup failed", HandshakeError::Failure(_) => "the handshake failed", - HandshakeError::Interrupted(_) => "the handshake was interrupted", + HandshakeError::WouldBlock(_) => "the handshake was interrupted", } } fn cause(&self) -> Option<&StdError> { match *self { HandshakeError::SetupFailure(ref e) => Some(e), - HandshakeError::Failure(ref s) | - HandshakeError::Interrupted(ref s) => Some(s.error()), + HandshakeError::Failure(ref s) | HandshakeError::WouldBlock(ref s) => Some(s.error()), } } } @@ -131,8 +129,7 @@ impl<S: Any + fmt::Debug> fmt::Display for HandshakeError<S> { f.write_str(StdError::description(self))?; match *self { HandshakeError::SetupFailure(ref e) => write!(f, ": {}", e)?, - HandshakeError::Failure(ref s) | - HandshakeError::Interrupted(ref s) => { + HandshakeError::Failure(ref s) | HandshakeError::WouldBlock(ref s) => { write!(f, ": {}", s.error())?; if let Some(err) = s.ssl().verify_result() { write!(f, ": {}", err)?; |