diff options
| author | Steven Fackler <[email protected]> | 2014-11-25 16:44:42 -0800 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2014-11-25 16:44:42 -0800 |
| commit | a7a9ef7eaa508a8437e5e23c16638d8b05877e6e (patch) | |
| tree | a4772718bad35de342c91f8aa67c03a9e1f1a977 /src | |
| parent | Fix deprecation warning (diff) | |
| download | rust-openssl-a7a9ef7eaa508a8437e5e23c16638d8b05877e6e.tar.xz rust-openssl-a7a9ef7eaa508a8437e5e23c16638d8b05877e6e.zip | |
Allow access to the underlying stream
The use case here is to allow methods like `set_read_timeout` to be
called.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ssl/mod.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ssl/mod.rs b/src/ssl/mod.rs index 245e401e..1985dcd0 100644 --- a/src/ssl/mod.rs +++ b/src/ssl/mod.rs @@ -436,6 +436,15 @@ impl<S: Stream> SslStream<S> { 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<c_int, SslError> { loop { |