Merge pull request #25 from nox/expose-io-error
Provide access to inner I/O error during handshake
This commit is contained in:
commit
3838b11fb7
|
|
@ -3,6 +3,7 @@
|
||||||
clippy::redundant_static_lifetimes,
|
clippy::redundant_static_lifetimes,
|
||||||
clippy::too_many_arguments,
|
clippy::too_many_arguments,
|
||||||
clippy::unreadable_literal,
|
clippy::unreadable_literal,
|
||||||
|
clippy::upper_case_acronyms,
|
||||||
improper_ctypes,
|
improper_ctypes,
|
||||||
non_camel_case_types,
|
non_camel_case_types,
|
||||||
non_snake_case,
|
non_snake_case,
|
||||||
|
|
|
||||||
|
|
@ -213,7 +213,7 @@ use ffi::{BIO_get_data, BIO_set_data, BIO_set_flags, BIO_set_init};
|
||||||
#[allow(bad_style)]
|
#[allow(bad_style)]
|
||||||
unsafe fn BIO_set_num(_bio: *mut ffi::BIO, _num: c_int) {}
|
unsafe fn BIO_set_num(_bio: *mut ffi::BIO, _num: c_int) {}
|
||||||
|
|
||||||
#[allow(bad_style)]
|
#[allow(bad_style, clippy::upper_case_acronyms)]
|
||||||
struct BIO_METHOD(*mut ffi::BIO_METHOD);
|
struct BIO_METHOD(*mut ffi::BIO_METHOD);
|
||||||
|
|
||||||
impl BIO_METHOD {
|
impl BIO_METHOD {
|
||||||
|
|
|
||||||
|
|
@ -292,6 +292,14 @@ impl<S> HandshakeError<S> {
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns a reference to the inner I/O error, if any.
|
||||||
|
pub fn as_io_error(&self) -> Option<&io::Error> {
|
||||||
|
match &self.0 {
|
||||||
|
ssl::HandshakeError::Failure(s) => s.error().io_error(),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<S> fmt::Debug for HandshakeError<S>
|
impl<S> fmt::Debug for HandshakeError<S>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue