GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — net: track bytesWritten in C++ land by addaleax · Pull Request #19551 · nodejs/node

Conversation

@addaleax

@addaleax addaleax commented Mar 23, 2018

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

javacodecreeks reacted with thumbs up emoji aks- reacted with hooray emoji
All reactions
  • 👍 1 reaction
  • 🎉 1 reaction
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. labels Mar 23, 2018
This was referenced Mar 24, 2018
src: refactor WriteWrap and ShutdownWrap #18676
Closed
Regression: Wrong value in bytesWritten for net.Socket #19562
Closed
@addaleax

addaleax commented Mar 24, 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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Mar 24, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

CI: https://ci.nodejs.org/job/node-test-commit/17146/
CI: https://ci.nodejs.org/job/node-test-commit/17148/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax
addaleax force-pushed the bytes-written branch from 5e7bf1c to 0ca4f45 Compare March 24, 2018 18:24
@addaleax

addaleax commented Mar 27, 2018

Copy link
Copy Markdown
Member Author

/cc @jasnell @apapirovski

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jasnell
jasnell approved these changes Mar 27, 2018
View reviewed changes
@addaleax addaleax added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Mar 27, 2018
@addaleax

addaleax commented Mar 27, 2018

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax addaleax removed the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Mar 28, 2018
addaleax added 4 commits March 29, 2018 23:21
@addaleax
net: track bytesWritten in C++ land
35b7e2f
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.
@addaleax
[squash] fix windows 🤞
0c5dea8
@addaleax
test: add regression test for large write
0b824ed
Fixes: nodejs#19562
@addaleax
src: clean up req.bytes tracking
6f6f00f
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
addaleax force-pushed the bytes-written branch from 0ca4f45 to 6f6f00f Compare March 29, 2018 21:21
@addaleax addaleax added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Mar 29, 2018
@addaleax

addaleax commented Mar 29, 2018

Copy link
Copy Markdown
Member Author

Rebased

CI: https://ci.nodejs.org/job/node-test-commit/17272/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Mar 30, 2018

Copy link
Copy Markdown
Member Author

Landed in abc8786...b7cfd27

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax addaleax closed this Mar 30, 2018
addaleax added a commit that referenced this pull request Mar 30, 2018
@addaleax
net: track bytesWritten in C++ land
923fb5c
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]>
addaleax added a commit that referenced this pull request Mar 30, 2018
@addaleax
test: add regression test for large write
1dc8eb4
Fixes: #19562

PR-URL: #19551
Reviewed-By: James M Snell <[email protected]>
addaleax added a commit that referenced this pull request Mar 30, 2018
@addaleax
src: clean up req.bytes tracking
b7cfd27
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]>
@addaleax
addaleax deleted the bytes-written branch March 30, 2018 12:29
@addaleax addaleax mentioned this pull request Apr 1, 2018
net,http2: merge write error handling & property names #19734
Closed
2 tasks done
@targos

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@targos targos added backport-requested-v9.x and removed author ready PRs with CI started, the required approvals, and no outstanding review comments. labels Apr 2, 2018
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request May 1, 2018
@addaleax @BridgeAR
net: track bytesWritten in C++ land
ec758fc
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]>
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request May 1, 2018
@addaleax @BridgeAR
test: add regression test for large write
2bcd795
Fixes: nodejs#19562

PR-URL: nodejs#19551
Reviewed-By: James M Snell <[email protected]>
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request May 1, 2018
@addaleax @BridgeAR
src: clean up req.bytes tracking
a85a08a
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]>
addaleax added a commit that referenced this pull request Jun 29, 2018
@addaleax
test: add regression test for large write
4f7f003
Fixes: #19562

PR-URL: #19551
Reviewed-By: James M Snell <[email protected]>
@MylesBorins MylesBorins mentioned this pull request Jul 9, 2018
v8.12.0 proposal #21593
Merged
rvagg pushed a commit that referenced this pull request Aug 16, 2018
@addaleax @rvagg
test: add regression test for large write
3c6464a
Fixes: #19562

PR-URL: #19551
Reviewed-By: James M Snell <[email protected]>
@vtjnash vtjnash mentioned this pull request Jan 13, 2020
win: pipe UV_HANDLE_EMULATE_IOCP implementation broken libuv/libuv#629
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

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

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@addaleax @targos @jasnell @nodejs-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.