Skip to content

Commit a027417

Browse files
committed
fix: special cased config constraint when maxIdleTimeout is 0
1 parent c6051da commit a027417

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/QUICConnection.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,16 @@ class QUICConnection extends EventTarget {
353353
}) {
354354
super();
355355
this.logger = logger ?? new Logger(`${this.constructor.name} ${scid}`);
356+
// Checking constraints
357+
if (
358+
config.keepAliveIntervalTime != null &&
359+
config.maxIdleTimeout !== 0 &&
360+
config.keepAliveIntervalTime >= config.maxIdleTimeout
361+
) {
362+
throw new errors.ErrorQUICConnectionInvalidConfig(
363+
'keepAliveIntervalTime must be shorter than maxIdleTimeout',
364+
);
365+
}
356366

357367
const quicheConfig = buildQuicheConfig(config);
358368
let conn: Connection;

0 commit comments

Comments
 (0)