Home / Function/ testAccountForHeaderOverhead() — netty Function Reference

testAccountForHeaderOverhead() — netty Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/HpackDecoderTest.java lines 631–660

    @Test
    public void testAccountForHeaderOverhead() throws Exception {
        final ByteBuf in = Unpooled.buffer(100);
        try {
            String headerName = "12345";
            String headerValue = "56789";
            long headerSize = headerName.length() + headerValue.length();
            hpackDecoder.setMaxHeaderListSize(headerSize);
            HpackEncoder hpackEncoder = new HpackEncoder(true);

            Http2Headers toEncode = new DefaultHttp2Headers();
            toEncode.add(headerName, headerValue);
            hpackEncoder.encodeHeaders(1, in, toEncode, NEVER_SENSITIVE);

            final Http2Headers decoded = new DefaultHttp2Headers();

            // SETTINGS_MAX_HEADER_LIST_SIZE is big enough for the header to fit...
            assertThat(hpackDecoder.getMaxHeaderListSize()).isGreaterThanOrEqualTo(headerSize);

            // ... but decode should fail because we add some overhead for each header entry
            assertThrows(Http2Exception.HeaderListSizeException.class, new Executable() {
                @Override
                public void execute() throws Throwable {
                    hpackDecoder.decode(1, in, decoded, true);
                }
            });
        } finally {
            in.release();
        }
    }

Domain

Subdomains

Calls

Frequently Asked Questions

What does testAccountForHeaderOverhead() do?
testAccountForHeaderOverhead() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/HpackDecoderTest.java.
Where is testAccountForHeaderOverhead() defined?
testAccountForHeaderOverhead() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/HpackDecoderTest.java at line 631.
What does testAccountForHeaderOverhead() call?
testAccountForHeaderOverhead() 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