Skip to content

Commit

Permalink
quic: proper custom inspect for QuicStream
Browse files Browse the repository at this point in the history
PR-URL: #34247
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
jasnell committed Jul 9, 2020
1 parent 0860b11 commit 458d243
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions lib/internal/quic/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const {
QuicSessionSharedState,
QLogStream,
} = require('internal/quic/util');
const util = require('util');
const assert = require('internal/assert');
const EventEmitter = require('events');
const fs = require('fs');
Expand Down Expand Up @@ -2713,23 +2712,17 @@ class QuicStream extends Duplex {
// TODO(@jasnell): Implement this
}

[kInspect]() {
[kInspect](depth, options) {
// TODO(@jasnell): Proper custom inspect implementation
const direction = this.bidirectional ? 'bidirectional' : 'unidirectional';
const initiated = this.serverInitiated ? 'server' : 'client';
const obj = {
return customInspect(this, {
id: this[kInternalState].id,
direction,
initiated,
writableState: this._writableState,
readableState: this._readableState,
stats: {
dataRate: this.dataRateHistogram,
dataSize: this.dataSizeHistogram,
dataAck: this.dataAckHistogram,
}
};
return `QuicStream ${util.format(obj)}`;
readableState: this._readableState
}, depth, options);
}

[kTrackWriteState](stream, bytes) {
Expand Down

0 comments on commit 458d243

Please sign in to comment.