From 575d37525ac563da918855a5b52d6bd52378c382 Mon Sep 17 00:00:00 2001 From: Aaron Weiss Date: Sat, 29 Nov 2014 04:57:01 -0500 Subject: [PATCH] Fixed SSL timeout implementation. --- src/conn.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/conn.rs b/src/conn.rs index bfb1aa7..8e5a9f7 100644 --- a/src/conn.rs +++ b/src/conn.rs @@ -41,23 +41,23 @@ impl Connection> { /// Creates a thread-safe TCP connection to the specified server over SSL. /// If the library is compiled without SSL support, this method panics. #[experimental] - #[cfg(feature = "ssl")] pub fn connect_ssl(host: &str, port: u16) -> IoResult>> { Connection::connect_ssl_internal(host, port, None) } + /// Creates a thread-safe TCP connection to the specificed server over SSL with a given timeout + /// in milliseconds. If the library is compiled without SSL support, this method panics. #[experimental] - #[cfg(feature = "ssl")] pub fn connect_ssl_with_timeout(host: &str, port: u16, timeout_ms: u64) -> IoResult>> { Connection::connect_ssl_internal(host, port, Some(timeout_ms)) } - /// Creates a thread-safe TCP connection to the specified server over SSL. - /// If the library is compiled without SSL support, this method panics. + /// Panics because SSL support was not included at compilation. #[experimental] #[cfg(not(feature = "ssl"))] - pub fn connect_ssl(host: &str, port: u16) -> IoResult>> { + fn connect_ssl_internal(host: &str, port: u16, timeout_ms: Option) + -> IoResult>> { panic!("Cannot connect to {}:{} over SSL without compiling with SSL support.", host, port) }