fn request_max_header_size_limit() {
        let mut config = crate::Config::new(crate::PROTOCOL_VERSION).unwrap();
        config
            .load_cert_chain_from_pem_file("examples/cert.crt")
            .unwrap();
        config
            .load_priv_key_from_pem_file("examples/cert.key")
            .unwrap();
        config.set_application_protos(&[b"h3"]).unwrap();
        config.set_initial_max_data(1500);
        config.set_initial_max_stream_data_bidi_local(150);
        config.set_initial_max_stream_data_bidi_remote(150);
        config.set_initial_max_stream_data_uni(150);
        config.set_initial_max_streams_bidi(5);
        config.set_initial_max_streams_uni(5);
        config.verify_peer(false);

        let mut h3_config = Config::new().unwrap();
        h3_config.set_max_field_section_size(65);

        let mut s = Session::with_configs(&mut config, &mut h3_config).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"aaaaaaa", b"aaaaaaaa"),
        ];

        let stream = s
            .client
            .send_request(&mut s.pipe.client, &req, true)
            .unwrap();

        s.advance().ok();

        assert_eq!(stream, 0);

        assert_eq!(s.poll_server(), Err(Error::ExcessiveLoad));

        assert_eq!(
            s.pipe.server.local_error.as_ref().unwrap().error_code,
            Error::to_wire(Error::ExcessiveLoad)
        );
    }
/// Tests that the max header list size setting is enforced.
Tests that the max header list size setting is enforced.
Tests that the max header list size setting is enforced .
fn request_max_header_size_limit() {
        let mut config = crate::Config::new(crate::PROTOCOL_VERSION).unwrap();
        config
            .load_cert_chain_from_pem_file("examples/cert.crt")
            .unwrap();
        config
            .load_priv_key_from_pem_file("examples/cert.key")
            .unwrap();
        config.set_application_protos(&[b"h3"]).unwrap();
        config.set_initial_max_data(1500);
        config.set_initial_max_stream_data_bidi_local(150);
        config.set_initial_max_stream_data_bidi_remote(150);
        config.set_initial_max_stream_data_uni(150);
        config.set_initial_max_streams_bidi(5);
        config.set_initial_max_streams_uni(5);
        config.verify_peer(false);
        let mut h3_config = Config::new().unwrap();
        h3_config.set_max_field_section_size(65);
        let mut s = Session::with_configs(&mut config, &mut h3_config).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"aaaaaaa", b"aaaaaaaa"),
        ];
        let stream = s
            .client
            .send_request(&mut s.pipe.client, &req, true)
            .unwrap();
        s.advance().ok();
        assert_eq!(stream, 0);
        assert_eq!(s.poll_server(), Err(Error::ExcessiveLoad));
        assert_eq!(
            s.pipe.server.local_error.as_ref().unwrap().error_code,
            Error::to_wire(Error::ExcessiveLoad)
        );
    }
fn request_max_header_size_limit ( ) { let mut config = crate :: Config :: new ( crate :: PROTOCOL_VERSION ) . unwrap ( ) ; config . load_cert_chain_from_pem_file ( " " ) . unwrap ( ) ; config . load_priv_key_from_pem_file ( " " ) . unwrap ( ) ; config . set_application_protos ( & [ b" " ] ) . unwrap ( ) ; config . set_initial_max_data ( 1500 ) ; config . set_initial_max_stream_data_bidi_local ( 150 ) ; config . set_initial_max_stream_data_bidi_remote ( 150 ) ; config . set_initial_max_stream_data_uni ( 150 ) ; config . set_initial_max_streams_bidi ( 5 ) ; config . set_initial_max_streams_uni ( 5 ) ; config . verify_peer ( false ) ; let mut h3_config = Config :: new ( ) . unwrap ( ) ; h3_config . set_max_field_section_size ( 65 ) ; let mut s = Session :: with_configs ( & mut config , & mut h3_config ) . 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" " ) ] ; let stream = s . client . send_request ( & mut s . pipe . client , & req , true ) . unwrap ( ) ; s . advance ( ) . ok ( ) ; assert_eq ! ( stream 0 ) ; assert_eq ! ( s poll_server ( ) Err ( Error ExcessiveLoad ) ) ; assert_eq ! ( s pipe server local_error as_ref ( ) unwrap ( ) error_code Error to_wire ( Error ExcessiveLoad ) ) ; }
Tests that the max header list size setting is enforced.
Tests that the max header list size setting is enforced .