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 <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
mscdex authored and MylesBorins committed Sep 12, 2017
1 parent 7feb994 commit b4e8850
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 @@ -881,9 +881,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 @@ -894,6 +891,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 b4e8850

Please sign in to comment.