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

        let req = vec![
            Header::new(b":method", b"GET"),
            Header::new(b":scheme", b"https"),
            Header::new(b":authority", b"quic.tech"),
            Header::new(b":path", b"/test"),
            Header::new(b"user-agent", b"quiche-test"),
        ];

        // We need to open all streams in the same flight, so we can't use the
        // Session::send_request() method because it also calls advance(),
        // otherwise the server would send a MAX_STREAMS frame and the client
        // wouldn't hit the streams limit.
        assert_eq!(s.client.send_request(&mut s.pipe.client, &req, true), Ok(0));
        assert_eq!(s.client.send_request(&mut s.pipe.client, &req, true), Ok(4));
        assert_eq!(s.client.send_request(&mut s.pipe.client, &req, true), Ok(8));
        assert_eq!(
            s.client.send_request(&mut s.pipe.client, &req, true),
            Ok(12)
        );
        assert_eq!(
            s.client.send_request(&mut s.pipe.client, &req, true),
            Ok(16)
        );

        assert_eq!(
            s.client.send_request(&mut s.pipe.client, &req, true),
            Err(Error::TransportError(crate::Error::StreamLimit))
        );
    }
/// Tests that Error::TransportError contains a transport error.
Tests that Error::TransportError contains a transport error.
Tests that Error :: TransportError contains a transport error .
fn transport_error() {
        let mut s = Session::default().unwrap();
        s.handshake().unwrap();
        let req = vec![
            Header::new(b":method", b"GET"),
            Header::new(b":scheme", b"https"),
            Header::new(b":authority", b"quic.tech"),
            Header::new(b":path", b"/test"),
            Header::new(b"user-agent", b"quiche-test"),
        ];
        // We need to open all streams in the same flight, so we can't use the
        // Session::send_request() method because it also calls advance(),
        // otherwise the server would send a MAX_STREAMS frame and the client
        // wouldn't hit the streams limit.
        assert_eq!(s.client.send_request(&mut s.pipe.client, &req, true), Ok(0));
        assert_eq!(s.client.send_request(&mut s.pipe.client, &req, true), Ok(4));
        assert_eq!(s.client.send_request(&mut s.pipe.client, &req, true), Ok(8));
        assert_eq!(
            s.client.send_request(&mut s.pipe.client, &req, true),
            Ok(12)
        );
        assert_eq!(
            s.client.send_request(&mut s.pipe.client, &req, true),
            Ok(16)
        );
        assert_eq!(
            s.client.send_request(&mut s.pipe.client, &req, true),
            Err(Error::TransportError(crate::Error::StreamLimit))
        );
    }
fn transport_error ( ) { let mut s = Session :: default ( ) . unwrap ( ) ; s . handshake ( ) . unwrap ( ) ; let req = vec ! [ Header new ( b" " b" " ) Header new ( b" " b" " ) Header new ( b" " b" " ) Header new ( b" " b" " ) Header new ( b" " b" " ) ] ; // We need to open all streams in the same flight, so we can't use the // Session::send_request() method because it also calls advance(), // otherwise the server would send a MAX_STREAMS frame and the client // wouldn't hit the streams limit. assert_eq ! ( s client send_request ( mut s pipe client req true ) Ok ( 0 ) ) ; assert_eq ! ( s client send_request ( mut s pipe client req true ) Ok ( 4 ) ) ; assert_eq ! ( s client send_request ( mut s pipe client req true ) Ok ( 8 ) ) ; assert_eq ! ( s client send_request ( mut s pipe client req true ) Ok ( 12 ) ) ; assert_eq ! ( s client send_request ( mut s pipe client req true ) Ok ( 16 ) ) ; assert_eq ! ( s client send_request ( mut s pipe client req true ) Err ( Error TransportError ( crate Error StreamLimit ) ) ) ; }
Tests that Error::TransportError contains a transport error.
Tests that Error :: TransportError contains a transport error .