Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions lib/internal/quic/quic.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ const onSessionHandshakeChannel = dc.channel('quic.session.handshake');
* @property {bigint|number} [maxConnectionsTotal] The maximum number of total connections
* @property {bigint|number} [maxStatelessResetsPerHost] The maximum number of stateless resets per host
* @property {bigint|number} [addressLRUSize] The size of the address LRU cache
* @property {bigint|number} [maxRetries] The maximum number of retriesw
* @property {bigint|number} [maxRetries] The maximum number of retries
* @property {number} [rxDiagnosticLoss] The receive diagnostic loss probability (range 0.0-1.0)
* @property {number} [txDiagnosticLoss] The transmit diagnostic loss probability (range 0.0-1.0)
* @property {number} [udpReceiveBufferSize] The UDP receive buffer size
Expand Down Expand Up @@ -507,7 +507,7 @@ setCallbacks({
if (session.destroyed) {
stream.destroy();
return;
};
}
session[kNewStream](stream, direction);
},

Expand Down Expand Up @@ -1383,29 +1383,21 @@ class QuicSession {
debug('finishing closing the session with an error', errorType, code, reason);
// Otherwise, errorType indicates the type of error that occurred, code indicates
// the specific error, and reason is an optional string describing the error.
// Note: code is guaranteed to be non-zero here due to early return above
switch (errorType) {
case 0: /* Transport Error */
if (code === 0n) {
this.destroy();
} else {
this.destroy(new ERR_QUIC_TRANSPORT_ERROR(code, reason));
}
this.destroy(new ERR_QUIC_TRANSPORT_ERROR(code, reason));
break;
case 1: /* Application Error */
if (code === 0n) {
this.destroy();
} else {
this.destroy(new ERR_QUIC_APPLICATION_ERROR(code, reason));
}
this.destroy(new ERR_QUIC_APPLICATION_ERROR(code, reason));
break;
case 2: /* Version Negotiation Error */
this.destroy(new ERR_QUIC_VERSION_NEGOTIATION_ERROR());
break;
case 3: /* Idle close */ {
case 3: /* Idle close */
// An idle close is not really an error. We can just destroy.
this.destroy();
break;
}
}
}

Expand Down