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

IncomingMessage.bytesRead #11507

Closed
ronag opened this issue Feb 22, 2017 · 2 comments
Closed

IncomingMessage.bytesRead #11507

ronag opened this issue Feb 22, 2017 · 2 comments
Labels
feature request Issues that request new features to be added to Node.js. http Issues or PRs related to the http subsystem.

Comments

@ronag
Copy link
Member

ronag commented Feb 22, 2017

Would be nice to have a bytesRead property on IncomingMessage the same as with fs.createReadStream. Since the underlying socket has a bytesRead property all that would be needed is a getter.

@addaleax addaleax added http Issues or PRs related to the http subsystem. feature request Issues that request new features to be added to Node.js. labels Feb 22, 2017
seppevs added a commit to seppevs/node that referenced this issue Feb 22, 2017
The bytesRead property is a getter that returns the value of
the bytesRead property on the socket that was passed in the
constructor. If no socket was passed, it will default to 0.

Fixes: nodejs#11507
@tniessen
Copy link
Member

tniessen commented Jun 1, 2017

What is your use case? If you just want to know the size of the message body so far, you can easily keep track of the size yourself.

@addaleax already pointed out in #11508 why using message.socket.bytesRead is not necessarily useful here, multiple messages may be sent within a singel TCP sesssion.

@apapirovski
Copy link
Member

Since the PR implementing something similar to what was requested here was closed with little support and there hasn't been any movement on this, as well as the fact that user-land solutions are possible — I'm going to go ahead and close this. That said, I'm not acting on any strong feelings or opinions here so feel free to re-open if you would still like to see this happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. http Issues or PRs related to the http subsystem.
Projects
None yet
Development

No branches or pull requests

4 participants