Skip to content
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

Closed

Conversation

lundibundi
Copy link
Member

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Depends on #34886
Refs: #445

/cc @nodejs/http @ronag

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.
@lundibundi lundibundi added the blocked PRs that are blocked by other issues or PRs. label Aug 23, 2020
@lundibundi lundibundi requested a review from a team as a code owner August 23, 2020 10:15
@nodejs-github-bot nodejs-github-bot added http Issues or PRs related to the http subsystem. stream Issues and PRs related to the stream subsystem. labels Aug 23, 2020
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/http
  • @nodejs/net

@@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In conflict with #34886

Copy link
Member Author

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. = (

Copy link
Member

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 :/

Copy link
Member Author

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.

Copy link
Member Author

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)

Copy link
Member

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.

@lundibundi lundibundi closed this Aug 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked PRs that are blocked by other issues or PRs. http Issues or PRs related to the http subsystem. stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants