Example usage for io.netty.handler.codec.http2 Http2CodecUtil calculateMaxHeaderListSizeGoAway

List of usage examples for io.netty.handler.codec.http2 Http2CodecUtil calculateMaxHeaderListSizeGoAway

Introduction

In this page you can find the example usage for io.netty.handler.codec.http2 Http2CodecUtil calculateMaxHeaderListSizeGoAway.

Prototype

public static long calculateMaxHeaderListSizeGoAway(long maxHeaderListSize) 

Source Link

Document

Calculate the threshold in bytes which should trigger a GO_AWAY if a set of headers exceeds this amount.

Usage

From source file:io.grpc.netty.FixedHttp2ConnectionDecoder.java

License:Apache License

/**
 * Calculate the threshold in bytes which should trigger a {@code GO_AWAY} if a set of headers exceeds this amount.
 * @param maxHeaderListSize/* w  w  w . jav  a2s.  c om*/
 *      <a href="https://tools.ietf.org/html/rfc7540#section-6.5.2">SETTINGS_MAX_HEADER_LIST_SIZE</a> for the local
 *      endpoint.
 * @return the threshold in bytes which should trigger a {@code GO_AWAY} if a set of headers exceeds this amount.
 */
protected long calculateMaxHeaderListSizeGoAway(long maxHeaderListSize) {
    return Http2CodecUtil.calculateMaxHeaderListSizeGoAway(maxHeaderListSize);
}

From source file:io.grpc.netty.GrpcHpackDecoder.java

License:Apache License

/**
 * Exposed Used for testing only! Default values used in the initial settings frame are overriden intentionally
 * for testing but violate the RFC if used outside the scope of testing.
 *///w w  w  . j ava 2s . c om
GrpcHpackDecoder(long maxHeaderListSize, int initialHuffmanDecodeCapacity, int maxHeaderTableSize) {
    this.maxHeaderListSize = checkPositive(maxHeaderListSize, "maxHeaderListSize");
    this.maxHeaderListSizeGoAway = Http2CodecUtil.calculateMaxHeaderListSizeGoAway(maxHeaderListSize);

    maxDynamicTableSize = encoderMaxDynamicTableSize = maxHeaderTableSize;
    maxDynamicTableSizeChangeRequired = false;
    hpackDynamicTable = new GrpcHpackDynamicTable(maxHeaderTableSize);
    hpackHuffmanDecoder = new GrpcHpackHuffmanDecoder(initialHuffmanDecodeCapacity);
}