-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
net: track bytesWritten in C++ land #19551
Conversation
Added a regression test for #19562 + a bit more cleanup to make sure |
/cc @jasnell @apapirovski |
Re-building Linux CI: https://ci.nodejs.org/job/node-test-commit-linux/17383/ |
Move tracking of `socket.bytesWritten` to C++ land. This makes it easier to provide this functionality for all `StreamBase` instances, and in particular should keep working when they have been 'consumed' in C++ in some way (e.g. for the network sockets that are underlying to TLS or HTTP2 streams). Also, this parallels `socket.bytesRead` a lot more now.
Simply always tell the caller how many bytes were written, rather than letting them track it. In the case of writing a string, also keep track of the bytes written by the earlier `DoTryWrite()`. Refs: nodejs#19562
Landed in abc8786...b7cfd27 |
Move tracking of `socket.bytesWritten` to C++ land. This makes it easier to provide this functionality for all `StreamBase` instances, and in particular should keep working when they have been 'consumed' in C++ in some way (e.g. for the network sockets that are underlying to TLS or HTTP2 streams). Also, this parallels `socket.bytesRead` a lot more now. PR-URL: #19551 Reviewed-By: James M Snell <[email protected]>
Fixes: #19562 PR-URL: #19551 Reviewed-By: James M Snell <[email protected]>
Simply always tell the caller how many bytes were written, rather than letting them track it. In the case of writing a string, also keep track of the bytes written by the earlier `DoTryWrite()`. Refs: #19562 PR-URL: #19551 Reviewed-By: James M Snell <[email protected]>
Should this be backported to |
Move tracking of `socket.bytesWritten` to C++ land. This makes it easier to provide this functionality for all `StreamBase` instances, and in particular should keep working when they have been 'consumed' in C++ in some way (e.g. for the network sockets that are underlying to TLS or HTTP2 streams). Also, this parallels `socket.bytesRead` a lot more now. PR-URL: nodejs#19551 Reviewed-By: James M Snell <[email protected]>
Fixes: nodejs#19562 PR-URL: nodejs#19551 Reviewed-By: James M Snell <[email protected]>
Simply always tell the caller how many bytes were written, rather than letting them track it. In the case of writing a string, also keep track of the bytes written by the earlier `DoTryWrite()`. Refs: nodejs#19562 PR-URL: nodejs#19551 Reviewed-By: James M Snell <[email protected]>
Fixes: #19562 PR-URL: #19551 Reviewed-By: James M Snell <[email protected]>
Fixes: #19562 PR-URL: #19551 Reviewed-By: James M Snell <[email protected]>
Move tracking of
socket.bytesWritten
to C++ land.This makes it easier to provide this functionality for all
StreamBase
instances, and in particular should keep workingwhen they have been 'consumed' in C++ in some way (e.g. for
the network sockets that are underlying to TLS or HTTP2 streams).
Also, this parallels
socket.bytesRead
a lot more now.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes