Home / Function/ channelRead() — netty Function Reference

channelRead() — netty Function Reference

Architecture documentation for the channelRead() function in Http3FrameToHttpObjectCodec.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  9b05fd47_3236_7abf_c543_7d67499c0ed7["channelRead()"]
  89b6ef44_7b8b_bd87_22f1_6b099293d25d["Http3FrameToHttpObjectCodec"]
  9b05fd47_3236_7abf_c543_7d67499c0ed7 -->|defined in| 89b6ef44_7b8b_bd87_22f1_6b099293d25d
  style 9b05fd47_3236_7abf_c543_7d67499c0ed7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http3/src/main/java/io/netty/handler/codec/http3/Http3FrameToHttpObjectCodec.java lines 80–110

    @Override
    protected void channelRead(ChannelHandlerContext ctx, Http3HeadersFrame frame) throws Exception {
        Http3Headers headers = frame.headers();
        long id = ((QuicStreamChannel) ctx.channel()).streamId();

        final CharSequence status = headers.status();

        // 100-continue response is a special case where we should not send a fin,
        // but we need to decode it as a FullHttpResponse to play nice with HttpObjectAggregator.
        if (null != status && HttpResponseStatus.CONTINUE.codeAsText().contentEquals(status)) {
            final FullHttpMessage fullMsg = newFullMessage(id, headers, ctx.alloc());
            ctx.fireChannelRead(fullMsg);
            return;
        }

        if (headers.method() == null && status == null) {
            // Must be trailers!
            LastHttpContent last = new DefaultLastHttpContent(Unpooled.EMPTY_BUFFER, validateHeaders);
            HttpConversionUtil.addHttp3ToHttpHeaders(id, headers, last.trailingHeaders(),
                    HttpVersion.HTTP_1_1, true, true);
            inboundTranslationInProgress = false;
            ctx.fireChannelRead(last);
        } else {
            HttpMessage req = newMessage(id, headers);
            if (!HttpUtil.isContentLengthSet(req)) {
                req.headers().add(HttpHeaderNames.TRANSFER_ENCODING, HttpHeaderValues.CHUNKED);
            }
            inboundTranslationInProgress = true;
            ctx.fireChannelRead(req);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does channelRead() do?
channelRead() is a function in the netty codebase, defined in codec-http3/src/main/java/io/netty/handler/codec/http3/Http3FrameToHttpObjectCodec.java.
Where is channelRead() defined?
channelRead() is defined in codec-http3/src/main/java/io/netty/handler/codec/http3/Http3FrameToHttpObjectCodec.java at line 80.

Analyze Your Own Codebase

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

Try Supermodel Free