-
Notifications
You must be signed in to change notification settings - Fork 30k
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/server: request.socket.bytesRead always 0 for IncomingMessage #3021
Comments
Same problem discovered here with node 4.3.1. |
@bnoordhuis Can you take a look? I need to use bytesRead/bytesWritten for analytics. |
ping @bnoordhuis @trevnorris ... a quick check on this indicates that in the test case above, it does not appear that the |
@bnoordhuis exactly |
If this is expected behavior, what are the next steps for this issue? Remove |
@cjihrig I don't think that there is an efficient way to fix it... I'd rather vote for its removal. Probably need to discuss it on @nodejs/ctc call |
@indutny What were some of the possible solutions you had in mind? @trevnorris said something about adding a |
@mscdex I don't think I have any efficient solutions in mind. One is about making this property a getter for the case of consumed sockets and increment counter manually in C++. |
The point about adding the data listener was only to illustrate that it could be fixed, but not that that is how it should be fixed. I personally like the idea of a getter. That has the lowest overhead for the common case of nit checking the property. |
This will provide `bytesRead` data on consumed sockets. Fix: nodejs#3021
Should be fixed by #6284 |
This will provide `bytesRead` data on consumed sockets. Fix: nodejs#3021 PR-URL: nodejs#6284 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This will provide `bytesRead` data on consumed sockets. Fix: nodejs#3021 PR-URL: nodejs#6284 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Tested with node.js v4.1.0 & v4.1.1 (v0.10.x does not have this issue)
See the following test (
parallel/test-http-bytesread.js
) to reproduce the issue;I could not yet figure out what causes this, any help is appreciated.
The text was updated successfully, but these errors were encountered: