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

        let (stream, req) = s.send_request(true).unwrap();
        assert_eq!(stream, 0);

        let ev_headers = Event::Headers {
            list: req,
            has_body: false,
        };

        assert_eq!(s.poll_server(), Ok((stream, ev_headers)));

        assert_eq!(s.poll_server(), Ok((stream, Event::Finished)));

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

        assert_eq!(s.poll_client(), Err(Error::Done));
    }
/// Try to send DATA frames before HEADERS.
Try to send DATA frames before HEADERS.
Try to send DATA frames before HEADERS .
fn body_response_before_headers() {
        let mut s = Session::default().unwrap();
        s.handshake().unwrap();
        let (stream, req) = s.send_request(true).unwrap();
        assert_eq!(stream, 0);
        let ev_headers = Event::Headers {
            list: req,
            has_body: false,
        };
        assert_eq!(s.poll_server(), Ok((stream, ev_headers)));
        assert_eq!(s.poll_server(), Ok((stream, Event::Finished)));
        assert_eq!(
            s.send_body_server(stream, true),
            Err(Error::FrameUnexpected)
        );
        assert_eq!(s.poll_client(), Err(Error::Done));
    }
fn body_response_before_headers ( ) { let mut s = Session :: default ( ) . unwrap ( ) ; s . handshake ( ) . unwrap ( ) ; let ( stream , req ) = s . send_request ( true ) . unwrap ( ) ; assert_eq ! ( stream 0 ) ; let ev_headers = Event :: Headers { list : req , has_body : false , } ; assert_eq ! ( s poll_server ( ) Ok ( ( stream ev_headers ) ) ) ; assert_eq ! ( s poll_server ( ) Ok ( ( stream Event Finished ) ) ) ; assert_eq ! ( s send_body_server ( stream true ) Err ( Error FrameUnexpected ) ) ; assert_eq ! ( s poll_client ( ) Err ( Error Done ) ) ; }
Try to send DATA frames before HEADERS.
Try to send DATA frames before HEADERS .