File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 55 ArrayIsArray,
66 MathMin,
77 Number,
8+ NumberIsFinite,
89 ObjectAssign,
910 ObjectDefineProperty,
1011 ObjectEntries,
@@ -3389,6 +3390,20 @@ class Http2SecureServer extends TLSServer {
33893390 this . headersTimeout = 60_000 ; // Minimum between 60 seconds or requestTimeout
33903391 this . requestTimeout = 300_000 ; // 5 minutes
33913392 this . connectionsCheckingInterval = 30_000 ; // 30 seconds
3393+ const keepAliveTimeout = options . keepAliveTimeout ;
3394+ if ( keepAliveTimeout !== undefined ) {
3395+ validateInteger ( keepAliveTimeout , 'keepAliveTimeout' , 0 ) ;
3396+ this . keepAliveTimeout = keepAliveTimeout ;
3397+ } else {
3398+ this . keepAliveTimeout = 5_000 ; // 5 seconds;
3399+ }
3400+ const keepAliveTimeoutBuffer = options . keepAliveTimeoutBuffer ;
3401+ // Optional buffer added to the keep-alive timeout when setting socket timeouts.
3402+ // Helps reduce ECONNRESET errors from clients by extending the internal timeout.
3403+ // Default is 1000ms if not specified.
3404+ const buf = keepAliveTimeoutBuffer ;
3405+ this . keepAliveTimeoutBuffer =
3406+ ( typeof buf === 'number' && NumberIsFinite ( buf ) && buf >= 0 ) ? buf : 1000 ;
33923407 this . shouldUpgradeCallback = function ( ) {
33933408 return this . listenerCount ( 'upgrade' ) > 0 ;
33943409 } ;
You can’t perform that action at this time.
0 commit comments