diff options
| author | Steven Fackler <[email protected]> | 2015-12-18 21:19:16 -0800 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2015-12-18 21:20:47 -0800 |
| commit | e85b49d3755375b3e535cbd4b07d4fbf953948cb (patch) | |
| tree | a084b204972855d4dc2b66cec999ebd93c7a3078 /openssl/src/ssl/tests | |
| parent | Merge pull request #324 from gentoo90/deps (diff) | |
| download | rust-openssl-e85b49d3755375b3e535cbd4b07d4fbf953948cb.tar.xz rust-openssl-e85b49d3755375b3e535cbd4b07d4fbf953948cb.zip | |
Work around the worst of clone bogusness
SslStream::{clone,try_clone} are inherently broken since the Ssl object
shared by both streams is only going to be talking to one stream. Stuff
like hyper depends on try_clone, so we'll leave it here for now but
minimize the brokenness to "no worse than what it used to be like".
They'll be removed in 0.8.
cc #325
Diffstat (limited to 'openssl/src/ssl/tests')
| -rw-r--r-- | openssl/src/ssl/tests/mod.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/openssl/src/ssl/tests/mod.rs b/openssl/src/ssl/tests/mod.rs index 7ed8fc3b..af3c005e 100644 --- a/openssl/src/ssl/tests/mod.rs +++ b/openssl/src/ssl/tests/mod.rs @@ -949,3 +949,11 @@ fn test_read_nonblocking() { assert!(bytes_read >= 5); assert_eq!(&input_buffer[..5], b"HTTP/"); } + +#[test] +fn broken_try_clone_doesnt_crash() { + let context = SslContext::new(SslMethod::Sslv23).unwrap(); + let inner = TcpStream::connect("example.com:443").unwrap(); + let stream1 = SslStream::connect(&context, inner).unwrap(); + let _stream2 = stream1.try_clone().unwrap(); +} |