/// Convert SSL_read() result to Poll<T> enum when we are doing SSL_shutdown()
Convert SSL_read() result to Poll enum when we are doing SSL_shutdown()
Convert SSL_read () result to Poll enum when we are doing SSL_shutdown ()
fn cvt_shutdown_ssl_read_ossl(
    r: Poll<Result<usize, ssl::Error>>,
) -> Poll<Result<_ShouldKeepPollSslRead, ssl::Error>> {
    match r {
        Poll::Ready(r) => match r {
            Ok(_) => {
                // We read some data, we should keep reading until we got ZERO_RETURN
                Poll::Ready(Ok(_ShouldKeepPollSslRead::KeepPollSslRead))
            }
            Err(e) => match e.code() {
                ErrorCode::WANT_READ | ErrorCode::WANT_WRITE => Poll::Pending,
                ErrorCode::ZERO_RETURN => Poll::Ready(Ok(_ShouldKeepPollSslRead::Finished)),
                // other side closed underlying socket without sending the close notify
                // we assume it is okay
                ErrorCode::SYSCALL if e.io_error().is_none() => {
                    Poll::Ready(Ok(_ShouldKeepPollSslRead::Finished))
                }
                _ => Poll::Ready(Err(e)),
            },
        },
        Poll::Pending => Poll::Pending,
    }
}
fn cvt_shutdown_ssl_read_ossl ( r : Poll < Result < usize , ssl :: Error > > , ) -> Poll < Result < _ShouldKeepPollSslRead , ssl :: Error > > { match r { Poll :: Ready ( r ) => match r { Ok ( _ ) => { // We read some data, we should keep reading until we got ZERO_RETURN Poll :: Ready ( Ok ( _ShouldKeepPollSslRead :: KeepPollSslRead ) ) } Err ( e ) => match e . code ( ) { ErrorCode :: WANT_READ | ErrorCode :: WANT_WRITE => Poll :: Pending , ErrorCode :: ZERO_RETURN => Poll :: Ready ( Ok ( _ShouldKeepPollSslRead :: Finished ) ) , // other side closed underlying socket without sending the close notify // we assume it is okay ErrorCode :: SYSCALL if e . io_error ( ) . is_none ( ) => { Poll :: Ready ( Ok ( _ShouldKeepPollSslRead :: Finished ) ) } _ => Poll :: Ready ( Err ( e ) ) , } , } , Poll :: Pending => Poll :: Pending , } }
Convert SSL_read() result to Poll<T> enum when we are doing SSL_shutdown()
Convert SSL_read () result to Poll<T > enum when we are doing SSL_shutdown ()
r
Poll<Result<usize, ssl::Error>>