FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

net: track bytesWritten in C++ land by addaleax · Pull Request #19551 · nodejs/node · GitHub

/ node Public

net: track bytesWritten in C++ land - #19551

Closed
addaleax wants to merge 4 commits into
nodejs:masterfrom
addaleax:bytes-written
Closed

net: track bytesWritten in C++ land#19551
addaleax wants to merge 4 commits into
nodejs:masterfrom
addaleax:bytes-written

Conversation

Copy link
Copy Markdown
Member

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.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. labels Mar 23, 2018

Copy link
Copy Markdown
Member Author

Added a regression test for #19562 + a bit more cleanup to make sure req.bytes always refers to the total length of the dispatched data

addaleax commented Mar 24, 2018
edited
Loading

Copy link
Copy Markdown
Member Author

Copy link
Copy Markdown
Member Author

/cc @jasnell @apapirovski

addaleax added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Mar 27, 2018

Copy link
Copy Markdown
Member Author

Re-building Linux CI: https://ci.nodejs.org/job/node-test-commit-linux/17383/

addaleax removed the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Mar 28, 2018
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
addaleax added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Mar 29, 2018

Copy link
Copy Markdown
Member Author

Copy link
Copy Markdown
Member Author

Landed in abc8786...b7cfd27

addaleax closed this Mar 30, 2018
addaleax added a commit that referenced this pull request Mar 30, 2018
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 <jasnell@gmail.com>
addaleax added a commit that referenced this pull request Mar 30, 2018
Fixes: #19562

PR-URL: #19551
Reviewed-By: James M Snell <jasnell@gmail.com>
addaleax added a commit that referenced this pull request Mar 30, 2018
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 <jasnell@gmail.com>
addaleax deleted the bytes-written branch March 30, 2018 12:29

targos commented Apr 2, 2018

Copy link
Copy Markdown
Member

Should this be backported to v9.x-staging? If yes please follow the guide and raise a backport PR, if not let me know or add the dont-land-on label.

targos added backport-requested-v9.x and removed author ready PRs that have at least one approval, no outstanding review comments, and a CI started. labels Apr 2, 2018
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request May 1, 2018
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 <jasnell@gmail.com>
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request May 1, 2018
Fixes: nodejs#19562

PR-URL: nodejs#19551
Reviewed-By: James M Snell <jasnell@gmail.com>
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request May 1, 2018
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 <jasnell@gmail.com>
addaleax added a commit that referenced this pull request Jun 29, 2018
Fixes: #19562

PR-URL: #19551
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins mentioned this pull request Jul 9, 2018
rvagg pushed a commit that referenced this pull request Aug 16, 2018
Fixes: #19562

PR-URL: #19551
Reviewed-By: James M Snell <jasnell@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL