-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Feature/tls wrap #5645
Feature/tls wrap #5645
Conversation
Thank you for contributing this pull request! Here are a few pointers to make sure your submission will be considered for inclusion. Commit indutny/node@304a0a3 has the following error(s):
Commit indutny/node@67be8ed has the following error(s):
Commit indutny/node@2f3c21b has the following error(s):
You can fix all these things without opening another issue. Please see CONTRIBUTING.md for more information |
Ok, fixed parallel requests error. |
Surprisingly it seems to be almost 2x faster than NOTE: comparing this scripts https://gist.github.com/indutny/b9913c3e2c99a20bbece |
src/node_crypto_bio.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/amout/amount/
I like where this is going, Fedor. |
New API - new benchmark: https://gist.github.com/69ea2768bad63f65babb.git @bnoordhuis @tjfontaine thoughts? |
src/node_wrap.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's up with style?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably not your code but casting away return values is so very '80s.
Whoa, this took really long time to get this working properly... I invite you (@bnoordhuis and @isaacs, probably others) to review it once again before merging this into master! |
And here are promising benchmark results (4 runs on osx):
|
Allocate buffer only if the next one isn't free.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge with regexpEscape() from lib/repl.js? You probably want to move it to lib/util.js.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, will do it after merge in a separate commit.
Originally contributed by @tjfontaine, but modified to be faster and more generic.
StreamWrapCallbacks is a helper class for incepting into uv_stream_t* management process.
Split `tls.js` into `_tls_legacy.js`, containing legacy `createSecurePair` API, and `_tls_wrap.js` containing new code based on `tls_wrap` binding. Remove tests that are no longer useful/valid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 or 1? That rather subverts the meaning of the .writeQueueSize property, doesn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I will just set it to 1 in javascript, its needed to make code work with net.js.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then .writeQueueSize should be changed to something like .hasPendingWrites=true|false.
A few more comments but mostly LGTM. |
I like how the API is a lot simpler for users to interact with, and most of the code looks good. But we have to figure out sessions before this is shippable, I think. |
WIP, doesn't work with concurrent connections (for some yet unknown reason).
Usage example: https://gist.github.com/indutny/f60d9724b0513de242ec
/cc @bnoordhuis @isaacs