diff options
Diffstat (limited to 'openssl/src/ssl/mod.rs')
| -rw-r--r-- | openssl/src/ssl/mod.rs | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index 183cf19d..d529347f 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -1070,16 +1070,10 @@ impl<S: Read + Write> SslStream<S> { if ret > 0 { Ok(stream) } else { - match stream.make_old_error(ret) { - SslError::StreamError(e) => { - // This is fine - nonblocking sockets will finish the handshake in read/write - if e.kind() == io::ErrorKind::WouldBlock { - Ok(stream) - } else { - Err(SslError::StreamError(e)) - } - } - e => Err(e), + match stream.make_error(ret) { + // This is fine - nonblocking sockets will finish the handshake in read/write + Error::WantRead(..) | Error::WantWrite(..) => Ok(stream), + _ => Err(stream.make_old_error(ret)), } } } @@ -1092,16 +1086,10 @@ impl<S: Read + Write> SslStream<S> { if ret > 0 { Ok(stream) } else { - match stream.make_old_error(ret) { - SslError::StreamError(e) => { - // This is fine - nonblocking sockets will finish the handshake in read/write - if e.kind() == io::ErrorKind::WouldBlock { - Ok(stream) - } else { - Err(SslError::StreamError(e)) - } - } - e => Err(e), + match stream.make_error(ret) { + // This is fine - nonblocking sockets will finish the handshake in read/write + Error::WantRead(..) | Error::WantWrite(..) => Ok(stream), + _ => Err(stream.make_old_error(ret)), } } } |