Home / Function/ doRead0() — netty Function Reference

doRead0() — netty Function Reference

Architecture documentation for the doRead0() function in AbstractHttp2StreamChannel.java from the netty codebase.

Function java Buffer Allocators calls 2 called by 2

Entity Profile

Dependency Diagram

graph TD
  a7768b47_c66a_4661_7c15_67b72fe39d9e["doRead0()"]
  2656dcfe_5cdb_7c7d_bc25_312393fe2e05["Http2ChannelUnsafe"]
  a7768b47_c66a_4661_7c15_67b72fe39d9e -->|defined in| 2656dcfe_5cdb_7c7d_bc25_312393fe2e05
  733793a3_8d1b_0b74_1c34_71e2c7d99a3e["fireChildRead()"]
  733793a3_8d1b_0b74_1c34_71e2c7d99a3e -->|calls| a7768b47_c66a_4661_7c15_67b72fe39d9e
  8c7ec287_e512_c36c_39d6_33286068a273["doBeginRead()"]
  8c7ec287_e512_c36c_39d6_33286068a273 -->|calls| a7768b47_c66a_4661_7c15_67b72fe39d9e
  62a996f5_c8c1_0a8e_97ff_db08bcadbc89["updateLocalWindowIfNeeded()"]
  a7768b47_c66a_4661_7c15_67b72fe39d9e -->|calls| 62a996f5_c8c1_0a8e_97ff_db08bcadbc89
  f2cc69e0_59ea_5712_041e_9061085aa163["isEndOfStream()"]
  a7768b47_c66a_4661_7c15_67b72fe39d9e -->|calls| f2cc69e0_59ea_5712_041e_9061085aa163
  style a7768b47_c66a_4661_7c15_67b72fe39d9e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2StreamChannel.java lines 957–982

        @SuppressWarnings("deprecation")
        void doRead0(Http2Frame frame, RecvByteBufAllocator.Handle allocHandle) {
            final int bytes;
            if (frame instanceof Http2DataFrame) {
                bytes = ((Http2DataFrame) frame).initialFlowControlledBytes();
                // It is important that we increment the flowControlledBytes before we call fireChannelRead(...)
                // as it may cause a read() that will call updateLocalWindowIfNeeded() and we need to ensure
                // in this case that we accounted for it.
                //
                // See https://github.com/netty/netty/issues/9663
                flowControlledBytes += bytes;
            } else {
                bytes = MIN_HTTP2_FRAME_SIZE;
            }

            // Let's keep track of what we received as the stream state itself will only be updated once the frame
            // was dispatched for reading which might cause problems if we try to close the channel in a write future.
            receivedEndOfStream |= isEndOfStream(frame);

            // Update before firing event through the pipeline to be consistent with other Channel implementation.
            allocHandle.attemptedBytesRead(bytes);
            allocHandle.lastBytesRead(bytes);
            allocHandle.incMessagesRead(1);

            pipeline().fireChannelRead(frame);
        }

Domain

Subdomains

Frequently Asked Questions

What does doRead0() do?
doRead0() is a function in the netty codebase, defined in codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2StreamChannel.java.
Where is doRead0() defined?
doRead0() is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/AbstractHttp2StreamChannel.java at line 957.
What does doRead0() call?
doRead0() calls 2 function(s): isEndOfStream, updateLocalWindowIfNeeded.
What calls doRead0()?
doRead0() is called by 2 function(s): doBeginRead, fireChildRead.

Analyze Your Own Codebase

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

Try Supermodel Free