Home / Class/ Http3PushStreamClientValidationHandler Class — netty Architecture

Http3PushStreamClientValidationHandler Class — netty Architecture

Architecture documentation for the Http3PushStreamClientValidationHandler class in Http3PushStreamClientValidationHandler.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  8b018e79_c943_f15d_ceb0_a3954d4af237["Http3PushStreamClientValidationHandler"]
  85797320_e09d_35c9_0e6e_8c5936bdea15["Http3PushStreamClientValidationHandler.java"]
  8b018e79_c943_f15d_ceb0_a3954d4af237 -->|defined in| 85797320_e09d_35c9_0e6e_8c5936bdea15
  9b0d652a_4259_04c9_922a_9ff71d76743c["Http3PushStreamClientValidationHandler()"]
  8b018e79_c943_f15d_ceb0_a3954d4af237 -->|method| 9b0d652a_4259_04c9_922a_9ff71d76743c
  26de0d78_d988_3b49_545f_9ea9c5a1f05f["channelRead()"]
  8b018e79_c943_f15d_ceb0_a3954d4af237 -->|method| 26de0d78_d988_3b49_545f_9ea9c5a1f05f
  059c0bb5_9cf3_6154_d68f_f6f5275b4b46["userEventTriggered()"]
  8b018e79_c943_f15d_ceb0_a3954d4af237 -->|method| 059c0bb5_9cf3_6154_d68f_f6f5275b4b46
  7eb3d1db_2397_ce77_e8ed_838567e6be06["isSharable()"]
  8b018e79_c943_f15d_ceb0_a3954d4af237 -->|method| 7eb3d1db_2397_ce77_e8ed_838567e6be06

Relationship Graph

Source Code

codec-http3/src/main/java/io/netty/handler/codec/http3/Http3PushStreamClientValidationHandler.java lines 27–89

final class Http3PushStreamClientValidationHandler
        extends Http3FrameTypeInboundValidationHandler<Http3RequestStreamFrame> {
    private final QpackAttributes qpackAttributes;
    private final QpackDecoder qpackDecoder;
    private final Http3RequestStreamCodecState decodeState;

    private long expectedLength = -1;
    private long seenLength;

    Http3PushStreamClientValidationHandler(QpackAttributes qpackAttributes, QpackDecoder qpackDecoder,
                                           Http3RequestStreamCodecState decodeState) {
        super(Http3RequestStreamFrame.class);
        this.qpackAttributes = qpackAttributes;
        this.qpackDecoder = qpackDecoder;
        this.decodeState = decodeState;
    }

    @Override
    void channelRead(ChannelHandlerContext ctx, Http3RequestStreamFrame frame) {
        if (frame instanceof Http3PushPromiseFrame) {
            ctx.fireChannelRead(frame);
            return;
        }

        if (frame instanceof Http3HeadersFrame) {
            Http3HeadersFrame headersFrame = (Http3HeadersFrame) frame;
            long maybeContentLength = validateHeaderFrameRead(headersFrame, ctx, decodeState);
            if (maybeContentLength >= 0) {
                expectedLength = maybeContentLength;
            } else if (maybeContentLength == INVALID_FRAME_READ) {
                return;
            }
        }

        if (frame instanceof Http3DataFrame) {
            final Http3DataFrame dataFrame = (Http3DataFrame) frame;
            long maybeContentLength = validateDataFrameRead(dataFrame, ctx, expectedLength, seenLength, false);
            if (maybeContentLength >= 0) {
                seenLength = maybeContentLength;
            } else if (maybeContentLength == INVALID_FRAME_READ) {
                return;
            }
        }
        ctx.fireChannelRead(frame);
    }

    @Override
    public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {
        if (evt == ChannelInputShutdownReadComplete.INSTANCE) {
            sendStreamAbandonedIfRequired(ctx, qpackAttributes, qpackDecoder, decodeState);
            if (!validateOnStreamClosure(ctx, expectedLength, seenLength, false)) {
                return;
            }
        }
        ctx.fireUserEventTriggered(evt);
    }

    @Override
    public boolean isSharable() {
        // This handle keeps state so we can't share it.
        return false;
    }
}

Frequently Asked Questions

What is the Http3PushStreamClientValidationHandler class?
Http3PushStreamClientValidationHandler is a class in the netty codebase, defined in codec-http3/src/main/java/io/netty/handler/codec/http3/Http3PushStreamClientValidationHandler.java.
Where is Http3PushStreamClientValidationHandler defined?
Http3PushStreamClientValidationHandler is defined in codec-http3/src/main/java/io/netty/handler/codec/http3/Http3PushStreamClientValidationHandler.java at line 27.

Analyze Your Own Codebase

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

Try Supermodel Free