Skip to content

Commit 2154a3c

Browse files
mscdexBridgeAR
authored andcommitted
net: move debug statement
This will allow `localAddress` to be properly set before writing debug output. PR-URL: #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 6db825a commit 2154a3c

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)