diff options
author | Evan Lucas <evanlucas@me.com> | 2017-05-05 06:10:43 -0500 |
---|---|---|
committer | Evan Lucas <evanlucas@me.com> | 2017-05-23 13:20:03 -0500 |
commit | ba0dbaa1930db93a9e988ce1a525c8b2054a2970 (patch) | |
tree | 33e07155aad40974f4f4f88c46b38eb37e15f217 /lib | |
parent | 60390cd7fb674865d9c8af89d5a2fecdae1c7ec0 (diff) | |
download | android-node-v8-ba0dbaa1930db93a9e988ce1a525c8b2054a2970.tar.gz android-node-v8-ba0dbaa1930db93a9e988ce1a525c8b2054a2970.tar.bz2 android-node-v8-ba0dbaa1930db93a9e988ce1a525c8b2054a2970.zip |
Revert "net: remove unnecessary process.nextTick()"
This reverts commit 571882c5a45872ac67e4e29513c4c8f23af9f781.
Removing the process.nextTick() call can prevent the consumer
from being able to catch error events.
PR-URL: https://github.com/nodejs/node/pull/12854
Fixes: https://github.com/nodejs/node/issues/12841
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/net.js b/lib/net.js index a3d778a448..67e191fa21 100644 --- a/lib/net.js +++ b/lib/net.js @@ -1005,7 +1005,10 @@ function lookupAndConnect(self, options) { // If host is an IP, skip performing a lookup var addressType = cares.isIP(host); if (addressType) { - internalConnect(self, host, port, addressType, localAddress, localPort); + nextTick(self[async_id_symbol], function() { + if (self.connecting) + internalConnect(self, host, port, addressType, localAddress, localPort); + }); return; } |