Skip to content

Commit b4e8850

Browse files
mscdexMylesBorins
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 7feb994 commit b4e8850

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
@@ -881,9 +881,6 @@ function internalConnect(
881881
var err;
882882

883883
if (localAddress || localPort) {
884-
debug('binding to localAddress: %s and localPort: %d (addressType: %d)',
885-
localAddress, localPort, addressType);
886-
887884
if (addressType === 4) {
888885
localAddress = localAddress || '0.0.0.0';
889886
err = self._handle.bind(localAddress, localPort);
@@ -894,6 +891,8 @@ function internalConnect(
894891
self.destroy(new TypeError('Invalid addressType: ' + addressType));
895892
return;
896893
}
894+
debug('binding to localAddress: %s and localPort: %d (addressType: %d)',
895+
localAddress, localPort, addressType);
897896

898897
if (err) {
899898
const ex = exceptionWithHostPort(err, 'bind', localAddress, localPort);

0 commit comments

Comments
 (0)