File tree Expand file tree Collapse file tree 4 files changed +16
-5
lines changed
Expand file tree Collapse file tree 4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -3544,10 +3544,10 @@ properties.
35443544 permitted on the ` Http2Session ` instances. ** Default:** ` true ` .
35453545* ` initialWindowSize ` {number} Specifies the _ sender's_ initial window size in
35463546 bytes for stream-level flow control. The minimum allowed value is 0. The
3547- maximum allowed value is 2<sup >32</sup >-1. ** Default:** ` 65535 ` .
3547+ maximum allowed value is 2<sup >32</sup >-1. ** Default:** ` 262144 ` .
35483548* ` maxFrameSize ` {number} Specifies the size in bytes of the largest frame
35493549 payload. The minimum allowed value is 16,384. The maximum allowed value is
3550- 2<sup >24</sup >-1. ** Default:** ` 16384 ` .
3550+ 2<sup >24</sup >-1. ** Default:** ` 32768 ` .
35513551* ` maxConcurrentStreams ` {number} Specifies the maximum number of concurrent
35523552 streams permitted on an ` Http2Session ` . There is no default value which
35533553 implies, at least theoretically, 2<sup >32</sup >-1 streams may be open
Original file line number Diff line number Diff line change @@ -3302,12 +3302,16 @@ function connectionListener(socket) {
33023302
33033303 socket [ kServer ] = this ;
33043304
3305+ // NGHTTP2_INITIAL_CONNECTION_WINDOW_SIZE default is 64KB, but we want to allow more data to be
3306+ // buffered without applying backpressure.
3307+ session . setLocalWindowSize ( 512 * 1024 ) ;
3308+
33053309 this . emit ( 'session' , session ) ;
33063310}
33073311
33083312function initializeOptions ( options ) {
33093313 assertIsObject ( options , 'options' ) ;
3310- options = { ...options } ;
3314+ options = { ...getDefaultSettings ( ) , ... options } ;
33113315 assertIsObject ( options . settings , 'options.settings' ) ;
33123316 options . settings = { ...options . settings } ;
33133317
Original file line number Diff line number Diff line change @@ -364,6 +364,13 @@ function getDefaultSettings() {
364364 settingsBuffer [ IDX_SETTINGS_ENABLE_CONNECT_PROTOCOL ] === 1 ;
365365 }
366366
367+ // NGHTTP2_INITIAL_WINDOW_SIZE default is 64KB, but we want to allow more data to be
368+ // buffered without applying backpressure.
369+ holder . initialWindowSize = MathMax ( holder . initialWindowSize , 256 * 1024 ) ;
370+
371+ // Default is 16KB.
372+ holder . maxFrameSize = MathMax ( 32 * 1024 , holder . maxFrameSize ) ;
373+
367374 if ( settingsBuffer [ IDX_SETTINGS_FLAGS + 1 ] ) holder . customSettings = addCustomSettingsToObj ( ) ;
368375
369376 return holder ;
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ const settings = http2.getDefaultSettings();
1717assert . strictEqual ( settings . headerTableSize , 4096 ) ;
1818assert . strictEqual ( settings . enablePush , true ) ;
1919assert . strictEqual ( settings . maxConcurrentStreams , 4294967295 ) ;
20- assert . strictEqual ( settings . initialWindowSize , 65535 ) ;
21- assert . strictEqual ( settings . maxFrameSize , 16384 ) ;
20+ assert . strictEqual ( settings . initialWindowSize , 256 * 1024 ) ;
21+ assert . strictEqual ( settings . maxFrameSize , 32 * 1024 ) ;
2222
2323assert . strictEqual ( binding . nghttp2ErrorString ( - 517 ) ,
2424 'GOAWAY has already been sent' ) ;
You can’t perform that action at this time.
0 commit comments