Skip to content

Commit

Permalink
quic: proper custom inspect for QuicSession
Browse files Browse the repository at this point in the history
PR-URL: #34247
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
jasnell committed Jul 9, 2020
1 parent b047930 commit 0860b11
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lib/internal/quic/core.js
Expand Up @@ -1777,10 +1777,9 @@ class QuicSession extends EventEmitter {
stream[kStreamReset](code);
}

[kInspect]() {
// TODO(@jasnell): A proper custom inspect implementation
[kInspect](depth, options) {
const state = this[kInternalState];
const obj = {
return customInspect(this, {
alpn: state.alpn,
cipher: this.cipher,
closing: this.closing,
Expand All @@ -1790,12 +1789,7 @@ class QuicSession extends EventEmitter {
maxStreams: this.maxStreams,
servername: this.servername,
streams: state.streams.size,
stats: {
handshakeAck: this.handshakeAckHistogram,
handshakeContinuation: this.handshakeContinuationHistogram,
}
};
return `${this.constructor.name} ${util.format(obj)}`;
}, depth, options);
}

[kSetSocket](socket) {
Expand Down

0 comments on commit 0860b11

Please sign in to comment.