From 8f8a05996c5b47ec9401aabb517d96ed2af5c36b Mon Sep 17 00:00:00 2001 From: Zeyla Hellyer Date: Wed, 7 Jun 2017 15:01:47 -0700 Subject: Upgrade rust-websocket, rust-openssl, and hyper Upgrade `rust-websocket` to v0.20, maintaining use of its sync client. This indirectly switches from `rust-openssl` v0.7 - which required openssl-1.0 on all platforms - to `native-tls`, which allows for use of schannel on Windows, Secure Transport on OSX, and openssl-1.1 on other platforms. Additionally, since hyper is no longer even a dependency of rust-websocket, we can safely and easily upgrade to `hyper` v0.10 and `multipart` v0.12. This commit is fairly experimental as it has not been tested on a long-running bot. --- src/error.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/error.rs') diff --git a/src/error.rs b/src/error.rs index 7795db5..6aa65e7 100644 --- a/src/error.rs +++ b/src/error.rs @@ -8,6 +8,8 @@ use ::model::ModelError; #[cfg(feature="hyper")] use hyper::Error as HyperError; +#[cfg(feature="native-tls")] +use native_tls::Error as TlsError; #[cfg(feature="voice")] use opus::Error as OpusError; #[cfg(feature="websocket")] @@ -83,6 +85,9 @@ pub enum Error { /// An error from the `hyper` crate. #[cfg(feature="hyper")] Hyper(HyperError), + /// An error from the `native-tls` crate. + #[cfg(feature="native-tls")] + Tls(TlsError), /// An error from the `rust-websocket` crate. #[cfg(feature="gateway")] WebSocket(WebSocketError), @@ -141,6 +146,13 @@ impl From for Error { } } +#[cfg(feature="native-tls")] +impl From for Error { + fn from(e: TlsError) -> Error { + Error::Tls(e) + } +} + #[cfg(feature="gateway")] impl From for Error { fn from(e: WebSocketError) -> Error { @@ -184,6 +196,8 @@ impl StdError for Error { Error::Hyper(ref inner) => inner.description(), #[cfg(feature="voice")] Error::Opus(ref inner) => inner.description(), + #[cfg(feature="native-tls")] + Error::Tls(ref inner) => inner.description(), #[cfg(feature="voice")] Error::Voice(_) => "Voice error", #[cfg(feature="gateway")] -- cgit v1.2.3