Home / Function/ protocolViolationWhenNegativeFrameLength() — netty Function Reference

protocolViolationWhenNegativeFrameLength() — netty Function Reference

Architecture documentation for the protocolViolationWhenNegativeFrameLength() function in WebSocket08FrameDecoderTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  9d09a4db_abdf_2194_fb0a_5305cb78882a["protocolViolationWhenNegativeFrameLength()"]
  30e9dec2_7c00_6d6f_80a0_7f9595928d39["WebSocket08FrameDecoderTest"]
  9d09a4db_abdf_2194_fb0a_5305cb78882a -->|defined in| 30e9dec2_7c00_6d6f_80a0_7f9595928d39
  style 9d09a4db_abdf_2194_fb0a_5305cb78882a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocket08FrameDecoderTest.java lines 77–96

    @Test
    void protocolViolationWhenNegativeFrameLength() {
        WebSocket08FrameDecoder decoder = new WebSocket08FrameDecoder(true, true, 65535, false);
        final EmbeddedChannel channel = new EmbeddedChannel(decoder);
        final ByteBuf invalidFrame = Unpooled.buffer(10).writeByte(0x81)
                                             .writeByte(0xFF).writeLong(-1L);

        Throwable exception = assertThrows(CorruptedWebSocketFrameException.class, new Executable() {
            @Override
            public void execute() {
                channel.writeInbound(invalidFrame);
            }
        });
        assertEquals("invalid data frame length (negative length)", exception.getMessage());

        CloseWebSocketFrame closeFrame = channel.readOutbound();
        assertEquals("invalid data frame length (negative length)", closeFrame.reasonText());
        assertTrue(closeFrame.release());
        assertFalse(channel.isActive());
    }

Domain

Subdomains

Frequently Asked Questions

What does protocolViolationWhenNegativeFrameLength() do?
protocolViolationWhenNegativeFrameLength() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocket08FrameDecoderTest.java.
Where is protocolViolationWhenNegativeFrameLength() defined?
protocolViolationWhenNegativeFrameLength() is defined in codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocket08FrameDecoderTest.java at line 77.

Analyze Your Own Codebase

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

Try Supermodel Free