-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http: remove usage of internal stream state from _http_server #34888
http: remove usage of internal stream state from _http_server #34888
Conversation
Looks like they have been accidentally moved in nodejs#31144. This also adds the proxy properties to Readable since they have been present all this time and removing them would be breaking.
Review requested:
|
@@ -703,7 +703,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._consuming && !req._readableState.resumeScheduled) | |||
if (!req._consuming && req.paused) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In conflict with #34886
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I tried to use .isPaused()
but it looks like the state[kPaused] === true
instead of state[kPaused] !== false
breaks it. = (
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what exactly is the correct way/property here... I would probably leave this as is :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it doesn't look like it will be easy to change.
The same goes for _http_incoming which uses readingMore = true
to basically pause the stream without actually pausing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ronag Just looked at http2 and quic, looks like that is present there as well. Could we think of some sort of public API for that? (I mean readingMore = true
etc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure at the moment why we are doing this but if quic is doing it then it’s probable I will look into it at some point.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesDepends on #34886
Refs: #445
/cc @nodejs/http @ronag