fn send_body_invalid_server_stream() {
        let mut s = Session::default().unwrap();
        s.handshake().unwrap();

        assert_eq!(s.send_body_server(0, true), Err(Error::FrameUnexpected));

        assert_eq!(
            s.send_body_server(s.server.control_stream_id.unwrap(), true),
            Err(Error::FrameUnexpected)
        );

        assert_eq!(
            s.send_body_server(
                s.server.local_qpack_streams.encoder_stream_id.unwrap(),
                true
            ),
            Err(Error::FrameUnexpected)
        );

        assert_eq!(
            s.send_body_server(
                s.server.local_qpack_streams.decoder_stream_id.unwrap(),
                true
            ),
            Err(Error::FrameUnexpected)
        );

        assert_eq!(
            s.send_body_server(s.server.peer_control_stream_id.unwrap(), true),
            Err(Error::FrameUnexpected)
        );

        assert_eq!(
            s.send_body_server(
                s.server.peer_qpack_streams.encoder_stream_id.unwrap(),
                true
            ),
            Err(Error::FrameUnexpected)
        );

        assert_eq!(
            s.send_body_server(
                s.server.peer_qpack_streams.decoder_stream_id.unwrap(),
                true
            ),
            Err(Error::FrameUnexpected)
        );
    }
/// Try to send DATA frames on wrong streams, ensure the API returns an
/// error before anything hits the transport layer.
Try to send DATA frames on wrong streams, ensure the API returns an
error before anything hits the transport layer.
Try to send DATA frames on wrong streams ensure the API returns an error before anything hits the transport layer .
fn send_body_invalid_server_stream() {
        let mut s = Session::default().unwrap();
        s.handshake().unwrap();
        assert_eq!(s.send_body_server(0, true), Err(Error::FrameUnexpected));
        assert_eq!(
            s.send_body_server(s.server.control_stream_id.unwrap(), true),
            Err(Error::FrameUnexpected)
        );
        assert_eq!(
            s.send_body_server(
                s.server.local_qpack_streams.encoder_stream_id.unwrap(),
                true
            ),
            Err(Error::FrameUnexpected)
        );
        assert_eq!(
            s.send_body_server(
                s.server.local_qpack_streams.decoder_stream_id.unwrap(),
                true
            ),
            Err(Error::FrameUnexpected)
        );
        assert_eq!(
            s.send_body_server(s.server.peer_control_stream_id.unwrap(), true),
            Err(Error::FrameUnexpected)
        );
        assert_eq!(
            s.send_body_server(
                s.server.peer_qpack_streams.encoder_stream_id.unwrap(),
                true
            ),
            Err(Error::FrameUnexpected)
        );
        assert_eq!(
            s.send_body_server(
                s.server.peer_qpack_streams.decoder_stream_id.unwrap(),
                true
            ),
            Err(Error::FrameUnexpected)
        );
    }
fn send_body_invalid_server_stream ( ) { let mut s = Session :: default ( ) . unwrap ( ) ; s . handshake ( ) . unwrap ( ) ; assert_eq ! ( s send_body_server ( 0 true ) Err ( Error FrameUnexpected ) ) ; assert_eq ! ( s send_body_server ( s server control_stream_id unwrap ( ) true ) Err ( Error FrameUnexpected ) ) ; assert_eq ! ( s send_body_server ( s server local_qpack_streams encoder_stream_id unwrap ( ) true ) Err ( Error FrameUnexpected ) ) ; assert_eq ! ( s send_body_server ( s server local_qpack_streams decoder_stream_id unwrap ( ) true ) Err ( Error FrameUnexpected ) ) ; assert_eq ! ( s send_body_server ( s server peer_control_stream_id unwrap ( ) true ) Err ( Error FrameUnexpected ) ) ; assert_eq ! ( s send_body_server ( s server peer_qpack_streams encoder_stream_id unwrap ( ) true ) Err ( Error FrameUnexpected ) ) ; assert_eq ! ( s send_body_server ( s server peer_qpack_streams decoder_stream_id unwrap ( ) true ) Err ( Error FrameUnexpected ) ) ; }
Try to send DATA frames on wrong streams, ensure the API returns an
error before anything hits the transport layer.
Try to send DATA frames on wrong streams ensure the API returns an error before anything hits the transport layer .