Skip to content

Commit

Permalink
stream: reset flowing state if no 'readable' or 'data' listeners.
Browse files Browse the repository at this point in the history
If we don't have any 'readable' or 'data' listeners and we are
not about to resume. Then reset flowing state to initial null state.

Fixes: #24474
  • Loading branch information
ronag committed Dec 20, 2019
1 parent fc553fd commit e70f3f3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/_stream_readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,8 @@ function updateReadableListening(self) {
// Crude way to check if we should resume
} else if (self.listenerCount('data') > 0) {
self.resume();
} else if (!state.readableListening) {
state.flowing = null;
}
}

Expand Down

0 comments on commit e70f3f3

Please sign in to comment.