File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -3288,12 +3288,16 @@ function connectionListener(socket) {
32883288
32893289 socket [ kServer ] = this ;
32903290
3291+ // NGHTTP2 default is 64KB, but we want to allow more data to be
3292+ // buffered without applying backpressure.
3293+ session . setLocalWindowSize ( 512 * 1024 ) ;
3294+
32913295 this . emit ( 'session' , session ) ;
32923296}
32933297
32943298function initializeOptions ( options ) {
32953299 assertIsObject ( options , 'options' ) ;
3296- options = { ...options } ;
3300+ options = { ...getDefaultSettings ( ) , ... options } ;
32973301 assertIsObject ( options . settings , 'options.settings' ) ;
32983302 options . settings = { ...options . settings } ;
32993303
Original file line number Diff line number Diff line change @@ -364,6 +364,10 @@ function getDefaultSettings() {
364364 settingsBuffer [ IDX_SETTINGS_ENABLE_CONNECT_PROTOCOL ] === 1 ;
365365 }
366366
367+ // NGHTTP2 default is 64KB, but we want to allow more data to be
368+ // buffered without applying backpressure.
369+ holder . initialWindowSize = 256 * 1024 ;
370+
367371 if ( settingsBuffer [ IDX_SETTINGS_FLAGS + 1 ] ) holder . customSettings = addCustomSettingsToObj ( ) ;
368372
369373 return holder ;
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ 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 ) ;
20+ assert . strictEqual ( settings . initialWindowSize , 256 * 1024 ) ;
2121assert . strictEqual ( settings . maxFrameSize , 16384 ) ;
2222
2323assert . strictEqual ( binding . nghttp2ErrorString ( - 517 ) ,
You can’t perform that action at this time.
0 commit comments