Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2020-07-14 06:05:43 +0300
committerJames M Snell <jasnell@gmail.com>2020-07-23 16:52:45 +0300
commita65296db2c544df91e0f6c8cbc8ff79691f870fe (patch)
tree3f36ddab417f8f44345a7a63ab13649f750886be /lib/internal/quic
parentda20287e1ae7d9651c91530a9e8d2ae7163a6788 (diff)
quic: remove stream pending code
Removing no longer needed code PR-URL: https://github.com/nodejs/node/pull/34351 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'lib/internal/quic')
-rw-r--r--lib/internal/quic/core.js43
1 files changed, 1 insertions, 42 deletions
diff --git a/lib/internal/quic/core.js b/lib/internal/quic/core.js
index a8d35c47a86..4fc7ca721a0 100644
--- a/lib/internal/quic/core.js
+++ b/lib/internal/quic/core.js
@@ -1666,7 +1666,6 @@ class QuicSession extends EventEmitter {
silentClose: false,
statelessReset: false,
stats: undefined,
- pendingStreams: new Set(),
streams: new Map(),
verifyErrorReason: undefined,
verifyErrorCode: undefined,
@@ -1969,12 +1968,6 @@ class QuicSession extends EventEmitter {
return;
state.destroyed = true;
- // Destroy any pending streams immediately. These
- // are streams that have been created but have not
- // yet been assigned an internal handle.
- for (const stream of state.pendingStreams)
- stream.destroy(error);
-
// Destroy any remaining streams immediately.
for (const stream of state.streams.values())
stream.destroy(error);
@@ -2534,7 +2527,7 @@ function streamOnResume() {
}
function streamOnPause() {
- if (!this.destroyed /* && !this.pending */)
+ if (!this.destroyed)
this[kHandle].readStop();
}
@@ -2658,9 +2651,6 @@ class QuicStream extends Duplex {
if (this.destroyed || state.closed)
return;
- if (this.pending)
- return this.once('ready', () => this[kClose](family, code));
-
state.closed = true;
state.aborted = this.readable || this.writable;
@@ -2712,11 +2702,6 @@ class QuicStream extends Duplex {
// TODO(@jasnell): Implement this later
}
- get pending() {
- // The id is set in the kSetHandle function
- return this[kInternalState].id === undefined;
- }
-
get aborted() {
return this[kInternalState].aborted;
}
@@ -2741,16 +2726,6 @@ class QuicStream extends Duplex {
if (this.destroyed)
return; // TODO(addaleax): Can this happen?
- // The stream should be corked while still pending
- // but just in case uncork
- // was called early, defer the actual write until the
- // ready event is emitted.
- if (this.pending) {
- return this.once('ready', () => {
- this[kWriteGeneric](writev, data, encoding, cb);
- });
- }
-
this[kUpdateTimer]();
const req = (writev) ?
writevGeneric(this, data, cb) :
@@ -2774,13 +2749,6 @@ class QuicStream extends Duplex {
// coming so that a fin stream packet can be
// sent.
_final(cb) {
- // The QuicStream should be corked while pending
- // so this shouldn't be called, but just in case
- // the stream was prematurely uncorked, defer the
- // operation until the ready event is emitted.
- if (this.pending)
- return this.once('ready', () => this._final(cb));
-
const handle = this[kHandle];
if (handle === undefined) {
cb();
@@ -2796,9 +2764,6 @@ class QuicStream extends Duplex {
}
_read(nread) {
- if (this.pending)
- return this.once('ready', () => this._read(nread));
-
if (this.destroyed) { // TODO(addaleax): Can this happen?
this.push(null);
return;
@@ -2848,12 +2813,6 @@ class QuicStream extends Duplex {
else if (typeof fd !== 'number')
throw new ERR_INVALID_ARG_TYPE('fd', ['number', 'FileHandle'], fd);
- if (this.pending) {
- return this.once('ready', () => {
- this.sendFD(fd, { offset, length }, ownsFd);
- });
- }
-
this[kUpdateTimer]();
this.ownsFd = ownsFd;