mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
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() {
|
||||
return this[kAborted] ||
|
||||
this._readableState.ended ||
|
||||
this.readableEnded ||
|
||||
this[kState].closed ||
|
||||
this[kStream].destroyed;
|
||||
}
|
||||
|
@ -207,11 +207,11 @@ class Worker extends EventEmitter {
|
||||
|
||||
const { stdout, stderr } = this[kParentSideStdio];
|
||||
|
||||
if (!stdout._readableState.ended) {
|
||||
if (!stdout.readableEnded) {
|
||||
debug(`[${threadId}] explicitly closes stdout for ${this.threadId}`);
|
||||
stdout.push(null);
|
||||
}
|
||||
if (!stderr._readableState.ended) {
|
||||
if (!stderr.readableEnded) {
|
||||
debug(`[${threadId}] explicitly closes stderr for ${this.threadId}`);
|
||||
stderr.push(null);
|
||||
}
|
||||
|
@ -422,7 +422,7 @@ function afterShutdown(status) {
|
||||
if (self.destroyed)
|
||||
return;
|
||||
|
||||
if (!self.readable || self._readableState.ended) {
|
||||
if (!self.readable || self.readableEnded) {
|
||||
debug('readableState ended, destroying');
|
||||
self.destroy();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user