From 1396143c661a9f9775328d60bc38b6fdec2a4c8a Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Wed, 8 Aug 2018 12:44:16 -0700 Subject: Add get_shutdown and set_shutdown --- openssl/src/ssl/test.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'openssl/src/ssl/test.rs') diff --git a/openssl/src/ssl/test.rs b/openssl/src/ssl/test.rs index 08a93b97..a8d69295 100644 --- a/openssl/src/ssl/test.rs +++ b/openssl/src/ssl/test.rs @@ -22,8 +22,9 @@ use ssl; #[cfg(any(ossl110, ossl111, libressl261))] use ssl::SslVersion; use ssl::{ - Error, HandshakeError, MidHandshakeSslStream, ShutdownResult, Ssl, SslAcceptor, SslConnector, - SslContext, SslFiletype, SslMethod, SslSessionCacheMode, SslStream, SslVerifyMode, StatusType, + Error, HandshakeError, MidHandshakeSslStream, ShutdownResult, ShutdownState, Ssl, SslAcceptor, + SslConnector, SslContext, SslFiletype, SslMethod, SslSessionCacheMode, SslStream, + SslVerifyMode, StatusType, }; #[cfg(any(ossl102, ossl110))] use x509::verify::X509CheckFlags; @@ -1013,8 +1014,14 @@ fn shutdown() { stream.read_exact(&mut buf).unwrap(); assert_eq!(b"hello", &buf); + assert_eq!(stream.get_shutdown(), ShutdownState::empty()); assert_eq!(stream.shutdown().unwrap(), ShutdownResult::Sent); + assert_eq!(stream.get_shutdown(), ShutdownState::SENT); assert_eq!(stream.shutdown().unwrap(), ShutdownResult::Received); + assert_eq!( + stream.get_shutdown(), + ShutdownState::SENT | ShutdownState::RECEIVED + ); guard.join().unwrap(); } -- cgit v1.2.3