Skip to content

Commit 377aa74

Browse files
authored
Merge pull request #1810 from mugdha273/UNDERTOW-2485
[UNDERTOW-2485]-Create a default constant for UndertowOptions.MAX_QUEUED_READ_BUFFERS
2 parents 1a6b6be + 329b18f commit 377aa74

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,14 @@ public class UndertowOptions {
361361
public static final Option<Integer> MAX_CONCURRENT_REQUESTS_PER_CONNECTION = Option.simple(UndertowOptions.class, "MAX_CONCURRENT_REQUESTS_PER_CONNECTION", Integer.class);
362362

363363
/**
364-
* The maximum number of buffers that will be used before reads are paused in framed protocols. Defaults to 10
364+
* Default value of {@link #MAX_QUEUED_READ_BUFFERS} option.
365+
*/
366+
public static final int DEFAULT_MAX_QUEUED_READ_BUFFERS = 16;
367+
368+
/**
369+
* The maximum number of buffers that will be used before reads are paused in framed protocols.
370+
* <p>
371+
* Defaults to {@link #DEFAULT_MAX_QUEUED_READ_BUFFERS}
365372
*/
366373
public static final Option<Integer> MAX_QUEUED_READ_BUFFERS = Option.simple(UndertowOptions.class, "MAX_QUEUED_READ_BUFFERS", Integer.class);
367374

core/src/main/java/io/undertow/server/protocol/framed/AbstractFramedChannel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public void handleEvent(AbstractFramedChannel channel) {
205205
*/
206206
protected AbstractFramedChannel(final StreamConnection connectedStreamChannel, ByteBufferPool bufferPool, FramePriority<C, R, S> framePriority, final PooledByteBuffer readData, OptionMap settings) {
207207
this.framePriority = framePriority;
208-
this.maxQueuedBuffers = settings.get(UndertowOptions.MAX_QUEUED_READ_BUFFERS, 16);
208+
this.maxQueuedBuffers = settings.get(UndertowOptions.MAX_QUEUED_READ_BUFFERS, UndertowOptions.DEFAULT_MAX_QUEUED_READ_BUFFERS);
209209
this.settings = settings;
210210
if (readData != null) {
211211
if(readData.getBuffer().hasRemaining()) {

0 commit comments

Comments
 (0)