Skip to content

Commit

Permalink
Revert "stream: add readableDidRead"
Browse files Browse the repository at this point in the history
This reverts commit 8306051.
  • Loading branch information
ronag committed Jul 30, 2021
1 parent 2b35078 commit e605c86
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 40 deletions.
1 change: 0 additions & 1 deletion lib/_http_incoming.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ function IncomingMessage(socket) {
this.statusMessage = null;
this.client = socket;

// TODO: Deprecate and remove.
this._consuming = false;
// Flag for when we decide that this message cannot possibly be
// read by the user, so there's no point continuing to handle it.
Expand Down
2 changes: 1 addition & 1 deletion lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ function resOnFinish(req, res, socket, state, server) {
// If the user never called req.read(), and didn't pipe() or
// .resume() or .on('data'), then we call req._dump() so that the
// bytes will be pulled off the wire.
if (!req.readableDidRead)
if (!req._consuming && !req._readableState.resumeScheduled)
req._dump();

// Make sure the requestTimeout is cleared before finishing.
Expand Down
14 changes: 0 additions & 14 deletions lib/internal/streams/readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ function ReadableState(options, stream, isDuplex) {
// If true, a maybeReadMore has been scheduled.
this.readingMore = false;

this.didRead = false;

this.decoder = null;
this.encoding = null;
if (options && options.encoding) {
Expand Down Expand Up @@ -544,8 +542,6 @@ Readable.prototype.read = function(n) {
if (ret !== null)
this.emit('data', ret);

state.didRead = true;

return ret;
};

Expand Down Expand Up @@ -849,9 +845,7 @@ function pipeOnDrain(src, dest) {

if ((!state.awaitDrainWriters || state.awaitDrainWriters.size === 0) &&
EE.listenerCount(src, 'data')) {
// TODO(ronag): Call resume() instead?
state.flowing = true;
state.didRead = true;
flow(src);
}
};
Expand Down Expand Up @@ -999,7 +993,6 @@ Readable.prototype.resume = function() {
function resume(stream, state) {
if (!state.resumeScheduled) {
state.resumeScheduled = true;
state.didRead = true;
process.nextTick(resume_, stream, state);
}
}
Expand Down Expand Up @@ -1184,13 +1177,6 @@ ObjectDefineProperties(Readable.prototype, {
}
},

readableDidRead: {
enumerable: false,
get: function() {
return this._readableState.didRead;
}
},

readableHighWaterMark: {
enumerable: false,
get: function() {
Expand Down
24 changes: 0 additions & 24 deletions test/parallel/test-stream-readable-didRead.js

This file was deleted.

0 comments on commit e605c86

Please sign in to comment.