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

        let (stream, req) = s.send_request(false).unwrap();

        let body = s.send_body_client(stream, true).unwrap();

        let mut recv_buf = vec![0; body.len()];

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

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

        assert_eq!(s.poll_server(), Ok((stream, Event::Data)));
        assert_eq!(s.recv_body_server(stream, &mut recv_buf), Ok(body.len()));

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

        let resp = s.send_response(stream, true).unwrap();

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

        assert_eq!(s.poll_client(), Ok((stream, ev_headers)));
        assert_eq!(s.poll_client(), Ok((stream, Event::Finished)));
    }
/// Send a request with one DATA frame, get a response with no body.
Send a request with one DATA frame, get a response with no body.
Send a request with one DATA frame get a response with no body .
fn request_one_chunk_response_no_body() {
        let mut s = Session::default().unwrap();
        s.handshake().unwrap();
        let (stream, req) = s.send_request(false).unwrap();
        let body = s.send_body_client(stream, true).unwrap();
        let mut recv_buf = vec![0; body.len()];
        let ev_headers = Event::Headers {
            list: req,
            has_body: true,
        };
        assert_eq!(s.poll_server(), Ok((stream, ev_headers)));
        assert_eq!(s.poll_server(), Ok((stream, Event::Data)));
        assert_eq!(s.recv_body_server(stream, &mut recv_buf), Ok(body.len()));
        assert_eq!(s.poll_server(), Ok((stream, Event::Finished)));
        let resp = s.send_response(stream, true).unwrap();
        let ev_headers = Event::Headers {
            list: resp,
            has_body: false,
        };
        assert_eq!(s.poll_client(), Ok((stream, ev_headers)));
        assert_eq!(s.poll_client(), Ok((stream, Event::Finished)));
    }
fn request_one_chunk_response_no_body ( ) { let mut s = Session :: default ( ) . unwrap ( ) ; s . handshake ( ) . unwrap ( ) ; let ( stream , req ) = s . send_request ( false ) . unwrap ( ) ; let body = s . send_body_client ( stream , true ) . unwrap ( ) ; let mut recv_buf = vec ! [ 0 body len ( ) ] ; let ev_headers = Event :: Headers { list : req , has_body : true , } ; assert_eq ! ( s poll_server ( ) Ok ( ( stream ev_headers ) ) ) ; assert_eq ! ( s poll_server ( ) Ok ( ( stream Event Data ) ) ) ; assert_eq ! ( s recv_body_server ( stream mut recv_buf ) Ok ( body len ( ) ) ) ; assert_eq ! ( s poll_server ( ) Ok ( ( stream Event Finished ) ) ) ; let resp = s . send_response ( stream , true ) . unwrap ( ) ; let ev_headers = Event :: Headers { list : resp , has_body : false , } ; assert_eq ! ( s poll_client ( ) Ok ( ( stream ev_headers ) ) ) ; assert_eq ! ( s poll_client ( ) Ok ( ( stream Event Finished ) ) ) ; }
Send a request with one DATA frame, get a response with no body.
Send a request with one DATA frame get a response with no body .