Skip to content

Commit

Permalink
net: move debug statement
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
mscdex authored and BridgeAR committed Aug 26, 2017
1 parent 6db825a commit 2154a3c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -887,9 +887,6 @@ function internalConnect(
var err;

if (localAddress || localPort) {
debug('binding to localAddress: %s and localPort: %d (addressType: %d)',
localAddress, localPort, addressType);

if (addressType === 4) {
localAddress = localAddress || '0.0.0.0';
err = self._handle.bind(localAddress, localPort);
Expand All @@ -900,6 +897,8 @@ function internalConnect(
self.destroy(new TypeError('Invalid addressType: ' + addressType));
return;
}
debug('binding to localAddress: %s and localPort: %d (addressType: %d)',
localAddress, localPort, addressType);

if (err) {
const ex = exceptionWithHostPort(err, 'bind', localAddress, localPort);
Expand Down

0 comments on commit 2154a3c

Please sign in to comment.