Example usage for io.netty.handler.codec.http2 Http2Settings maxFrameSize

List of usage examples for io.netty.handler.codec.http2 Http2Settings maxFrameSize

Introduction

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

Prototype

public Http2Settings maxFrameSize(int value) 

Source Link

Document

Sets the SETTINGS_MAX_FRAME_SIZE value.

Usage

From source file:com.linecorp.armeria.client.HttpClientPipelineConfigurator.java

License:Apache License

private Http2Settings http2Settings() {
    final Http2Settings http2Settings = new Http2Settings();
    if (clientFactory.initialHttp2StreamWindowSize() != DEFAULT_WINDOW_SIZE) {
        http2Settings.initialWindowSize(clientFactory.initialHttp2StreamWindowSize());
    }/* w w w  .  j av  a2s. c  o  m*/
    if (clientFactory.http2MaxFrameSize() != DEFAULT_MAX_FRAME_SIZE) {
        http2Settings.maxFrameSize(clientFactory.http2MaxFrameSize());
    }
    return http2Settings;
}

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

License:Apache License

@Override
public Http2Settings localSettings() {
    Http2Settings settings = new Http2Settings();
    Http2FrameReader.Configuration config = frameReader.configuration();
    Http2HeadersDecoder.Configuration headersConfig = config.headersConfiguration();
    Http2FrameSizePolicy frameSizePolicy = config.frameSizePolicy();
    settings.initialWindowSize(flowController().initialWindowSize());
    settings.maxConcurrentStreams(connection.remote().maxActiveStreams());
    settings.headerTableSize(headersConfig.maxHeaderTableSize());
    settings.maxFrameSize(frameSizePolicy.maxFrameSize());
    settings.maxHeaderListSize(headersConfig.maxHeaderListSize());
    if (!connection.isServer()) {
        // Only set the pushEnabled flag if this is a client endpoint.
        settings.pushEnabled(connection.local().allowPushTo());
    }/*from  w w  w . ja v  a2s.  c om*/
    return settings;
}

From source file:io.vertx.core.http.impl.HttpUtils.java

License:Open Source License

public static void fromVertxInitialSettings(boolean server, io.vertx.core.http.Http2Settings vertxSettings,
        Http2Settings nettySettings) {
    if (vertxSettings != null) {
        if (!server && vertxSettings.isPushEnabled() != DEFAULT_ENABLE_PUSH) {
            nettySettings.pushEnabled(vertxSettings.isPushEnabled());
        }//w w w .  j  a  v  a  2  s. c om
        if (vertxSettings.getHeaderTableSize() != DEFAULT_HEADER_TABLE_SIZE) {
            nettySettings.put('\u0001', (Long) vertxSettings.getHeaderTableSize());
        }
        if (vertxSettings.getInitialWindowSize() != DEFAULT_INITIAL_WINDOW_SIZE) {
            nettySettings.initialWindowSize(vertxSettings.getInitialWindowSize());
        }
        if (vertxSettings.getMaxConcurrentStreams() != DEFAULT_MAX_CONCURRENT_STREAMS) {
            nettySettings.maxConcurrentStreams(vertxSettings.getMaxConcurrentStreams());
        }
        if (vertxSettings.getMaxFrameSize() != DEFAULT_MAX_FRAME_SIZE) {
            nettySettings.maxFrameSize(vertxSettings.getMaxFrameSize());
        }
        if (vertxSettings.getMaxHeaderListSize() != DEFAULT_MAX_HEADER_LIST_SIZE) {
            nettySettings.maxHeaderListSize(vertxSettings.getMaxHeaderListSize());
        }
        Map<Integer, Long> extraSettings = vertxSettings.getExtraSettings();
        if (extraSettings != null) {
            extraSettings.forEach((code, setting) -> {
                nettySettings.put((char) (int) code, setting);
            });
        }
    }
}

From source file:io.vertx.core.http.impl.HttpUtils.java

License:Open Source License

public static Http2Settings fromVertxSettings(io.vertx.core.http.Http2Settings settings) {
    Http2Settings converted = new Http2Settings();
    converted.pushEnabled(settings.isPushEnabled());
    converted.maxFrameSize(settings.getMaxFrameSize());
    converted.initialWindowSize(settings.getInitialWindowSize());
    converted.headerTableSize(settings.getHeaderTableSize());
    converted.maxConcurrentStreams(settings.getMaxConcurrentStreams());
    converted.maxHeaderListSize(settings.getMaxHeaderListSize());
    if (settings.getExtraSettings() != null) {
        settings.getExtraSettings().forEach((key, value) -> {
            converted.put((char) (int) key, value);
        });/*from w  w  w. j a  v a2s.co m*/
    }
    return converted;
}