Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UNDERTOW-2481] Add DEFAULT_HTTP2_SETTINGS_INITIAL_WINDOW_SIZE #1678

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/src/main/java/io/undertow/UndertowOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ public class UndertowOptions {
* Max frame size for HTTP2.
* <br>UNIT: Bytes.
*/
public static final int DEFAULT_HTTP2_SETTINGS_INITIAL_WINDOW_SIZE = 65535;
/**
* Default value of {@link #HTTP2_SETTINGS_INITIAL_WINDOW_SIZE}. <br>UNIT: Bytes.
*/
public static final Option<Integer> HTTP2_SETTINGS_MAX_FRAME_SIZE = Option.simple(UndertowOptions.class, "HTTP2_SETTINGS_MAX_FRAME_SIZE", Integer.class);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ public class Http2Channel extends AbstractFramedChannel<Http2Channel, AbstractHt

static final int CONTINUATION_FLAG_END_HEADERS = 0x4;

public static final int DEFAULT_INITIAL_WINDOW_SIZE = 65535;

static final byte[] PREFACE_BYTES = {
0x50, 0x52, 0x49, 0x20, 0x2a, 0x20, 0x48, 0x54,
0x54, 0x50, 0x2f, 0x32, 0x2e, 0x30, 0x0d, 0x0a,
Expand Down Expand Up @@ -226,7 +224,7 @@ public class Http2Channel extends AbstractFramedChannel<Http2Channel, AbstractHt
/**
* The initial window size for newly created channels, guarded by {@link #flowControlLock}
*/
private volatile int initialSendWindowSize = DEFAULT_INITIAL_WINDOW_SIZE;
private volatile int initialSendWindowSize = UndertowOptions.DEFAULT_HTTP2_SETTINGS_INITIAL_WINDOW_SIZE;
/**
* How much data we can send to the remote endpoint, at the connection level, guarded by {@link #flowControlLock}
*/
Expand All @@ -253,7 +251,7 @@ public Http2Channel(StreamConnection connectedStreamChannel, String protocol, By
streamIdCounter = clientSide ? (fromUpgrade ? 3 : 1) : 2;

pushEnabled = settings.get(UndertowOptions.HTTP2_SETTINGS_ENABLE_PUSH, true);
this.initialReceiveWindowSize = settings.get(UndertowOptions.HTTP2_SETTINGS_INITIAL_WINDOW_SIZE, DEFAULT_INITIAL_WINDOW_SIZE);
this.initialReceiveWindowSize = settings.get(UndertowOptions.HTTP2_SETTINGS_INITIAL_WINDOW_SIZE, UndertowOptions.DEFAULT_HTTP2_SETTINGS_INITIAL_WINDOW_SIZE);
this.receiveWindowSize = initialReceiveWindowSize;
this.receiveMaxConcurrentStreams = settings.get(UndertowOptions.HTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, UndertowOptions.DEFAULT_HTTP2_SETTINGS_MAX_CONCURRENT_STREAMS);

Expand Down
Loading