net: make Socket.connect() consistently asynchronous#8180
net: make Socket.connect() consistently asynchronous#8180cjihrig wants to merge 3 commits intonodejs:masterfrom cjihrig:hard-coded-ips
Conversation
lib/net.js
Outdated
|
I like the refactor, but don't get what you trying to get with this approach? The |
|
@indutny sorry that the description of this PR is a bit unclear. This started as work for #8140 (answering your ping 😄). Along the way I realized that the argument checking was a little problematic, as it was possible to have an asynchronous I added the |
|
Well, just remove |
|
@indutny updated! |
|
@indutny ping |
lib/net.js
Outdated
There was a problem hiding this comment.
Might as well follow the pattern and include what the request port was
`Socket.prototype.connect()` establishes a connection synchronously in some cases and asynchronously in others. This commit makes it consistently asynchronous. This commit also removes hard coded IPv4 addresses, and throws on bad inputs immediately, instead of potentially after an asynchronous operation.
|
@tjfontaine updated based on your comments |
|
@tjfontaine Anything else holding this up? @cjihrig ping back on Friday if no other response. |
|
@trevnorris Friday ping |
There was a problem hiding this comment.
Sorry I didn't notice this before. Why removal of the port range check?
|
@cjihrig Things LGTM. Go ahead and squash it, add the usual commit fields and land it. Thanks. :) |
Socket.prototype.connect() sometimes throws on bad inputs after an asynchronous operation. This commit makes the input validation synchronous. This commit also removes some hard coded IP addresses. PR-URL: #8180 Fixes: #8140 Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: Timothy J Fontaine <tjfontaine@gmail.com>
|
Landed in b636ba8 |
Socket.prototype.connect()follows a synchronous code path in some cases and an asynchronous one in others. This commit makes it consistently asynchronous. This commit also removes hard coded IPv4 addresses, and throws on bad inputs immediately, instead of potentially after an asynchronous operation. Closes #8140EDIT: I might have worded this slightly wrong. The connection is made asynchronously. I was referring to the fact that one current code path involved a DNS lookup, while the other two completed synchronously.