From a7a9ef7eaa508a8437e5e23c16638d8b05877e6e Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Tue, 25 Nov 2014 16:44:42 -0800 Subject: [PATCH] Allow access to the underlying stream The use case here is to allow methods like `set_read_timeout` to be called. --- src/ssl/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ssl/mod.rs b/src/ssl/mod.rs index 245e401e6..1985dcd0e 100644 --- a/src/ssl/mod.rs +++ b/src/ssl/mod.rs @@ -436,6 +436,15 @@ impl SslStream { SslStream::new_server_from(ssl, stream) } + /// Returns a mutable reference to the underlying stream + /// + /// ## Warning + /// `read`ing or `write`ing directly to the underlying stream will most + /// likely desynchronize the SSL session. + pub fn get_inner(&mut self) -> &mut S { + &mut self.stream + } + fn in_retry_wrapper(&mut self, blk: |&Ssl| -> c_int) -> Result { loop { -- GitLab