-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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: honor default values in Socket constructor #19971
Conversation
Is this Line 288 in 5a8fcd0
still needed with this change? |
Can a test be included for this? |
This also changes the default value for const socket = new net.Socket(fd);
assert(socket.readable);
assert(socket.writable); |
Good catch. I'll remove that line.
Will do
Yes, isn't that what the documentation implies? |
Yes it seems consistent with the docs but not with the code, not sure which one is correct :) |
lib/internal/wrap_js_stream.js
Outdated
@@ -72,6 +72,8 @@ class JSStreamWrap extends Socket { | |||
this.stream = stream; | |||
this[kCurrentWriteRequest] = null; | |||
this[kCurrentShutdownRequest] = null; | |||
this.readable = true; | |||
this.writable = true; |
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.
Just a thought, but I think it might be more correct to forward these values from stream
itself?
4a21f02
to
e4fdba2
Compare
Updated with comments addressed. PTAL. Thanks |
CI has a lot of red. |
Yes, I have to fix the test for Windows. The other failures seem unrelated. |
Specifically `readable` and `writable` that default to `false`. Fixes: libuv/libuv#1794
e4fdba2
to
485bea9
Compare
Added a fix for the test. New CI: https://ci.nodejs.org/job/node-test-pull-request/14400/ |
CI looks good now. |
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.
LGTM. I'm only a little worried about the behavior change described in #19971 (comment).
Should we consider it a bug fix?
Might as well run CitGM if we have concerns: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1380/ |
Landed in 67e2a15 🎉 |
Specifically `readable` and `writable` that default to `false`. PR-URL: nodejs#19971 Fixes: libuv/libuv#1794 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Are we ok with this being semver-patch? |
Specifically `readable` and `writable` that default to `false`. PR-URL: #19971 Fixes: libuv/libuv#1794 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Specifically
readable
andwritable
that default tofalse
.Fixes: libuv/libuv#1794
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes