Skip to content

Commit e90fbbf

Browse files
committed
[UNDERTOW-2311] Introducing Http2Channel.DEFAULT_MAX_CONCURRENT_STREAMS
1 parent 24ac5fb commit e90fbbf

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

core/src/main/java/io/undertow/UndertowOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public class UndertowOptions {
267267
public static final Option<Boolean> HTTP2_SETTINGS_ENABLE_PUSH = Option.simple(UndertowOptions.class, "HTTP2_SETTINGS_ENABLE_PUSH", Boolean.class);
268268

269269
/**
270-
* The maximum number of concurrent
270+
* The maximum number of concurrent http2 streams.
271271
*/
272272
public static final Option<Integer> HTTP2_SETTINGS_MAX_CONCURRENT_STREAMS = Option.simple(UndertowOptions.class, "HTTP2_SETTINGS_MAX_CONCURRENT_STREAMS", Integer.class);
273273

core/src/main/java/io/undertow/protocols/http2/Http2Channel.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ public class Http2Channel extends AbstractFramedChannel<Http2Channel, AbstractHt
121121

122122
public static final int DEFAULT_INITIAL_WINDOW_SIZE = 65535;
123123

124+
public static final int DEFAULT_MAX_CONCURRENT_STREAMS = -1;
125+
124126
static final byte[] PREFACE_BYTES = {
125127
0x50, 0x52, 0x49, 0x20, 0x2a, 0x20, 0x48, 0x54,
126128
0x54, 0x50, 0x2f, 0x32, 0x2e, 0x30, 0x0d, 0x0a,
@@ -214,7 +216,7 @@ public Http2Channel(StreamConnection connectedStreamChannel, String protocol, By
214216
pushEnabled = settings.get(UndertowOptions.HTTP2_SETTINGS_ENABLE_PUSH, true);
215217
this.initialReceiveWindowSize = settings.get(UndertowOptions.HTTP2_SETTINGS_INITIAL_WINDOW_SIZE, DEFAULT_INITIAL_WINDOW_SIZE);
216218
this.receiveWindowSize = initialReceiveWindowSize;
217-
this.receiveMaxConcurrentStreams = settings.get(UndertowOptions.HTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, -1);
219+
this.receiveMaxConcurrentStreams = settings.get(UndertowOptions.HTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, DEFAULT_MAX_CONCURRENT_STREAMS);
218220

219221
this.protocol = protocol == null ? Http2OpenListener.HTTP2 : protocol;
220222
this.maxHeaders = settings.get(UndertowOptions.MAX_HEADERS, clientSide ? -1 : UndertowOptions.DEFAULT_MAX_HEADERS);

0 commit comments

Comments
 (0)