Home / Function/ testDecodeLargerThanMaxHeaderListSizeUpdatesDynamicTable() — netty Function Reference

testDecodeLargerThanMaxHeaderListSizeUpdatesDynamicTable() — netty Function Reference

Architecture documentation for the testDecodeLargerThanMaxHeaderListSizeUpdatesDynamicTable() function in HpackDecoderTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  436b2063_3365_d816_0974_8cd1a6877e80["testDecodeLargerThanMaxHeaderListSizeUpdatesDynamicTable()"]
  499468ca_3853_024b_2b80_17090ef6cd43["HpackDecoderTest"]
  436b2063_3365_d816_0974_8cd1a6877e80 -->|defined in| 499468ca_3853_024b_2b80_17090ef6cd43
  47ac4151_0b50_9884_0d18_472d1c51065d["decode()"]
  436b2063_3365_d816_0974_8cd1a6877e80 -->|calls| 47ac4151_0b50_9884_0d18_472d1c51065d
  style 436b2063_3365_d816_0974_8cd1a6877e80 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/HpackDecoderTest.java lines 569–608

    @Test
    public void testDecodeLargerThanMaxHeaderListSizeUpdatesDynamicTable() throws Http2Exception {
        final ByteBuf in = Unpooled.buffer(300);
        try {
            hpackDecoder.setMaxHeaderListSize(200);
            HpackEncoder hpackEncoder = new HpackEncoder(true);

            // encode headers that are slightly larger than maxHeaderListSize
            Http2Headers toEncode = new DefaultHttp2Headers();
            toEncode.add("test_1", "1");
            toEncode.add("test_2", "2");
            toEncode.add("long", String.format("%0100d", 0).replace('0', 'A'));
            toEncode.add("test_3", "3");
            hpackEncoder.encodeHeaders(1, in, toEncode, NEVER_SENSITIVE);

            // decode the headers, we should get an exception
            final Http2Headers decoded = new DefaultHttp2Headers();
            assertThrows(Http2Exception.HeaderListSizeException.class, new Executable() {
                @Override
                public void execute() throws Throwable {
                    hpackDecoder.decode(1, in, decoded, true);
                }
            });

            // but the dynamic table should have been updated, so that later blocks
            // can refer to earlier headers
            in.clear();
            // 0x80, "indexed header field representation"
            // index 62, the first (most recent) dynamic table entry
            in.writeByte(0x80 | 62);
            Http2Headers decoded2 = new DefaultHttp2Headers();
            hpackDecoder.decode(1, in, decoded2, true);

            Http2Headers golden = new DefaultHttp2Headers();
            golden.add("test_3", "3");
            assertEquals(golden, decoded2);
        } finally {
            in.release();
        }
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does testDecodeLargerThanMaxHeaderListSizeUpdatesDynamicTable() do?
testDecodeLargerThanMaxHeaderListSizeUpdatesDynamicTable() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/HpackDecoderTest.java.
Where is testDecodeLargerThanMaxHeaderListSizeUpdatesDynamicTable() defined?
testDecodeLargerThanMaxHeaderListSizeUpdatesDynamicTable() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/HpackDecoderTest.java at line 569.
What does testDecodeLargerThanMaxHeaderListSizeUpdatesDynamicTable() call?
testDecodeLargerThanMaxHeaderListSizeUpdatesDynamicTable() calls 1 function(s): decode.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free