Home / Function/ checkCloseFrameBody() — netty Function Reference

checkCloseFrameBody() — netty Function Reference

Architecture documentation for the checkCloseFrameBody() function in WebSocket08FrameDecoder.java from the netty codebase.

Function java ProtocolCodecs HTTP calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  f1364653_ca1d_d1d2_a507_8c02eba374f5["checkCloseFrameBody()"]
  c9b44ce3_48da_97b4_c171_21f4f8367ad8["WebSocket08FrameDecoder"]
  f1364653_ca1d_d1d2_a507_8c02eba374f5 -->|defined in| c9b44ce3_48da_97b4_c171_21f4f8367ad8
  0cc1f80d_2de8_eba7_1c1b_044be6cac6ba["decode()"]
  0cc1f80d_2de8_eba7_1c1b_044be6cac6ba -->|calls| f1364653_ca1d_d1d2_a507_8c02eba374f5
  052c117e_18bc_0a73_ffad_e40824a99630["protocolViolation()"]
  f1364653_ca1d_d1d2_a507_8c02eba374f5 -->|calls| 052c117e_18bc_0a73_ffad_e40824a99630
  style f1364653_ca1d_d1d2_a507_8c02eba374f5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket08FrameDecoder.java lines 468–491

    protected void checkCloseFrameBody(
            ChannelHandlerContext ctx, ByteBuf buffer) {
        if (buffer == null || !buffer.isReadable()) {
            return;
        }
        if (buffer.readableBytes() < 2) {
            protocolViolation(ctx, buffer, WebSocketCloseStatus.INVALID_PAYLOAD_DATA, "Invalid close frame body");
        }

        // Must have 2 byte integer within the valid range
        int statusCode = buffer.getShort(buffer.readerIndex());
        if (!WebSocketCloseStatus.isValidStatusCode(statusCode)) {
            protocolViolation(ctx, buffer, "Invalid close frame getStatus code: " + statusCode);
        }

        // May have UTF-8 message
        if (buffer.readableBytes() > 2) {
            try {
                new Utf8Validator().check(buffer, buffer.readerIndex() + 2, buffer.readableBytes() - 2);
            } catch (CorruptedWebSocketFrameException ex) {
                protocolViolation(ctx, buffer, ex);
            }
        }
    }

Subdomains

Called By

Frequently Asked Questions

What does checkCloseFrameBody() do?
checkCloseFrameBody() is a function in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket08FrameDecoder.java.
Where is checkCloseFrameBody() defined?
checkCloseFrameBody() is defined in codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket08FrameDecoder.java at line 468.
What does checkCloseFrameBody() call?
checkCloseFrameBody() calls 1 function(s): protocolViolation.
What calls checkCloseFrameBody()?
checkCloseFrameBody() is called by 1 function(s): decode.

Analyze Your Own Codebase

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

Try Supermodel Free