stream: cleanup use of internal ended state
PR-URL: https://github.com/nodejs/node/pull/29645 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
06929956f9
commit
fed05cc414
@ -303,7 +303,7 @@ class Http2ServerRequest extends Readable {
|
|||||||
|
|
||||||
get complete() {
|
get complete() {
|
||||||
return this[kAborted] ||
|
return this[kAborted] ||
|
||||||
this._readableState.ended ||
|
this.readableEnded ||
|
||||||
this[kState].closed ||
|
this[kState].closed ||
|
||||||
this[kStream].destroyed;
|
this[kStream].destroyed;
|
||||||
}
|
}
|
||||||
|
@ -207,11 +207,11 @@ class Worker extends EventEmitter {
|
|||||||
|
|
||||||
const { stdout, stderr } = this[kParentSideStdio];
|
const { stdout, stderr } = this[kParentSideStdio];
|
||||||
|
|
||||||
if (!stdout._readableState.ended) {
|
if (!stdout.readableEnded) {
|
||||||
debug(`[${threadId}] explicitly closes stdout for ${this.threadId}`);
|
debug(`[${threadId}] explicitly closes stdout for ${this.threadId}`);
|
||||||
stdout.push(null);
|
stdout.push(null);
|
||||||
}
|
}
|
||||||
if (!stderr._readableState.ended) {
|
if (!stderr.readableEnded) {
|
||||||
debug(`[${threadId}] explicitly closes stderr for ${this.threadId}`);
|
debug(`[${threadId}] explicitly closes stderr for ${this.threadId}`);
|
||||||
stderr.push(null);
|
stderr.push(null);
|
||||||
}
|
}
|
||||||
|
@ -422,7 +422,7 @@ function afterShutdown(status) {
|
|||||||
if (self.destroyed)
|
if (self.destroyed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!self.readable || self._readableState.ended) {
|
if (!self.readable || self.readableEnded) {
|
||||||
debug('readableState ended, destroying');
|
debug('readableState ended, destroying');
|
||||||
self.destroy();
|
self.destroy();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user