Java Code Examples for io.netty.handler.codec.http2.Http2Settings#maxFrameSize()

The following examples show how to use io.netty.handler.codec.http2.Http2Settings#maxFrameSize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HttpServerPipelineConfigurator.java    From armeria with Apache License 2.0 6 votes vote down vote up
private Http2Settings http2Settings() {
    final Http2Settings settings = new Http2Settings();
    final int initialWindowSize = config.http2InitialStreamWindowSize();
    if (initialWindowSize != Http2CodecUtil.DEFAULT_WINDOW_SIZE) {
        settings.initialWindowSize(initialWindowSize);
    }

    final int maxFrameSize = config.http2MaxFrameSize();
    if (maxFrameSize != Http2CodecUtil.DEFAULT_MAX_FRAME_SIZE) {
        settings.maxFrameSize(maxFrameSize);
    }

    // Not using the value greater than 2^31-1 because some HTTP/2 client implementations use a signed
    // 32-bit integer to represent an HTTP/2 SETTINGS parameter value.
    settings.maxConcurrentStreams(Math.min(config.http2MaxStreamsPerConnection(), Integer.MAX_VALUE));
    settings.maxHeaderListSize(config.http2MaxHeaderListSize());
    return settings;
}
 
Example 2
Source File: Http2SettingsSpec.java    From reactor-netty with Apache License 2.0 5 votes vote down vote up
Http2SettingsSpec(Build build) {
	Http2Settings settings = build.http2Settings;
	headerTableSize = settings.headerTableSize();
	initialWindowSize = settings.initialWindowSize();
	maxConcurrentStreams = settings.maxConcurrentStreams();
	maxFrameSize = settings.maxFrameSize();
	maxHeaderListSize = settings.maxHeaderListSize();
	pushEnabled = settings.pushEnabled();
}
 
Example 3
Source File: HttpClientConfig.java    From reactor-netty with Apache License 2.0 5 votes vote down vote up
Http2Settings http2Settings() {
	Http2Settings settings = Http2Settings.defaultSettings();

	if (http2Settings != null) {
		Long headerTableSize = http2Settings.headerTableSize();
		if (headerTableSize != null) {
			settings.headerTableSize(headerTableSize);
		}

		Integer initialWindowSize = http2Settings.initialWindowSize();
		if (initialWindowSize != null) {
			settings.initialWindowSize(initialWindowSize);
		}

		Long maxConcurrentStreams = http2Settings.maxConcurrentStreams();
		if (maxConcurrentStreams != null) {
			settings.maxConcurrentStreams(maxConcurrentStreams);
		}

		Integer maxFrameSize = http2Settings.maxFrameSize();
		if (maxFrameSize != null) {
			settings.maxFrameSize(maxFrameSize);
		}

		settings.maxHeaderListSize(http2Settings.maxHeaderListSize());

		Boolean pushEnabled = http2Settings.pushEnabled();
		if (pushEnabled != null) {
			settings.pushEnabled(pushEnabled);
		}
	}

	return settings;
}
 
Example 4
Source File: HttpServerConfig.java    From reactor-netty with Apache License 2.0 5 votes vote down vote up
Http2Settings http2Settings() {
	Http2Settings settings = Http2Settings.defaultSettings();

	if (http2Settings != null) {
		Long headerTableSize = http2Settings.headerTableSize();
		if (headerTableSize != null) {
			settings.headerTableSize(headerTableSize);
		}

		Integer initialWindowSize = http2Settings.initialWindowSize();
		if (initialWindowSize != null) {
			settings.initialWindowSize(initialWindowSize);
		}

		Long maxConcurrentStreams = http2Settings.maxConcurrentStreams();
		if (maxConcurrentStreams != null) {
			settings.maxConcurrentStreams(maxConcurrentStreams);
		}

		Integer maxFrameSize = http2Settings.maxFrameSize();
		if (maxFrameSize != null) {
			settings.maxFrameSize(maxFrameSize);
		}

		settings.maxHeaderListSize(http2Settings.maxHeaderListSize());

		Boolean pushEnabled = http2Settings.pushEnabled();
		if (pushEnabled != null) {
			settings.pushEnabled(pushEnabled);
		}
	}

	return settings;
}
 
Example 5
Source File: HttpClientPipelineConfigurator.java    From armeria with Apache License 2.0 5 votes vote down vote up
private Http2Settings http2Settings() {
    final Http2Settings settings = new Http2Settings();
    final int initialWindowSize = clientFactory.http2InitialStreamWindowSize();
    if (initialWindowSize != DEFAULT_WINDOW_SIZE) {
        settings.initialWindowSize(initialWindowSize);
    }
    final int maxFrameSize = clientFactory.http2MaxFrameSize();
    if (maxFrameSize != DEFAULT_MAX_FRAME_SIZE) {
        settings.maxFrameSize(maxFrameSize);
    }
    settings.maxHeaderListSize(clientFactory.http2MaxHeaderListSize());
    return settings;
}