Home / File/ Http3RequestStreamValidationHandler.java — netty Source File

Http3RequestStreamValidationHandler.java — netty Source File

Architecture documentation for Http3RequestStreamValidationHandler.java, a java file in the netty codebase.

Entity Profile

Relationship Graph

Source Code

/*
 * Copyright 2020 The Netty Project
 *
 * The Netty Project licenses this file to you under the Apache License,
 * version 2.0 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at:
 *
 *   https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
package io.netty.handler.codec.http3;

import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelPromise;
import io.netty.channel.socket.ChannelInputShutdownReadComplete;

import java.util.function.BooleanSupplier;

import static io.netty.handler.codec.http.HttpMethod.HEAD;
import static io.netty.handler.codec.http3.Http3FrameValidationUtils.frameTypeUnexpected;
import static io.netty.handler.codec.http3.Http3RequestStreamValidationUtils.INVALID_FRAME_READ;
import static io.netty.handler.codec.http3.Http3RequestStreamValidationUtils.sendStreamAbandonedIfRequired;
import static io.netty.handler.codec.http3.Http3RequestStreamValidationUtils.validateClientWrite;
import static io.netty.handler.codec.http3.Http3RequestStreamValidationUtils.validateDataFrameRead;
import static io.netty.handler.codec.http3.Http3RequestStreamValidationUtils.validateHeaderFrameRead;
import static io.netty.handler.codec.http3.Http3RequestStreamValidationUtils.validateOnStreamClosure;

final class Http3RequestStreamValidationHandler extends Http3FrameTypeDuplexValidationHandler<Http3RequestStreamFrame> {
    private final boolean server;
    private final BooleanSupplier goAwayReceivedSupplier;
    private final QpackAttributes qpackAttributes;
    private final QpackDecoder qpackDecoder;
    private final Http3RequestStreamCodecState decodeState;
    private final Http3RequestStreamCodecState encodeState;

    private boolean clientHeadRequest;
    private long expectedLength = -1;
    private long seenLength;

    static ChannelHandler newServerValidator(QpackAttributes qpackAttributes, QpackDecoder decoder,
                                             Http3RequestStreamCodecState encodeState,
                                             Http3RequestStreamCodecState decodeState) {
        return new Http3RequestStreamValidationHandler(true, () -> false, qpackAttributes, decoder,
                encodeState, decodeState);
    }

    static ChannelHandler newClientValidator(BooleanSupplier goAwayReceivedSupplier, QpackAttributes qpackAttributes,
                                             QpackDecoder decoder, Http3RequestStreamCodecState encodeState,
                                             Http3RequestStreamCodecState decodeState) {
        return new Http3RequestStreamValidationHandler(false, goAwayReceivedSupplier, qpackAttributes, decoder,
                encodeState, decodeState);
    }

    private Http3RequestStreamValidationHandler(boolean server, BooleanSupplier goAwayReceivedSupplier,
// ... (80 more lines)

Domain

Subdomains

Frequently Asked Questions

What does Http3RequestStreamValidationHandler.java do?
Http3RequestStreamValidationHandler.java is a source file in the netty codebase, written in java. It belongs to the Buffer domain, Allocators subdomain.
Where is Http3RequestStreamValidationHandler.java in the architecture?
Http3RequestStreamValidationHandler.java is located at codec-http3/src/main/java/io/netty/handler/codec/http3/Http3RequestStreamValidationHandler.java (domain: Buffer, subdomain: Allocators, directory: codec-http3/src/main/java/io/netty/handler/codec/http3).

Analyze Your Own Codebase

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

Try Supermodel Free