From 3744e31e1652afc6ab648e777128918da68b478c Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Mon, 25 Dec 2017 21:35:09 -0700 Subject: Fix a bunch of FIXMEs --- openssl/src/ssl/error.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'openssl/src/ssl/error.rs') 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 { SetupFailure(ErrorStack), /// The handshake failed. Failure(MidHandshakeSslStream), - /// 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), + WouldBlock(MidHandshakeSslStream), } impl StdError for HandshakeError { @@ -113,15 +112,14 @@ impl StdError for HandshakeError { 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 fmt::Display for HandshakeError { 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)?; -- cgit v1.2.3