Skip to content
This repository was archived by the owner on Aug 31, 2018. It is now read-only.

Commit 269fe15

Browse files
mscdexOlivia Hugger
authored and
Olivia Hugger
committed
net: move debug statement
This will allow `localAddress` to be properly set before writing debug output. PR-URL: nodejs/node#12616 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 59b25ab commit 269fe15

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/net.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -887,9 +887,6 @@ function internalConnect(
887887
var err;
888888

889889
if (localAddress || localPort) {
890-
debug('binding to localAddress: %s and localPort: %d (addressType: %d)',
891-
localAddress, localPort, addressType);
892-
893890
if (addressType === 4) {
894891
localAddress = localAddress || '0.0.0.0';
895892
err = self._handle.bind(localAddress, localPort);
@@ -900,6 +897,8 @@ function internalConnect(
900897
self.destroy(new TypeError('Invalid addressType: ' + addressType));
901898
return;
902899
}
900+
debug('binding to localAddress: %s and localPort: %d (addressType: %d)',
901+
localAddress, localPort, addressType);
903902

904903
if (err) {
905904
const ex = exceptionWithHostPort(err, 'bind', localAddress, localPort);

0 commit comments

Comments
 (0)