Browse Source

net: move debug statement

This will allow `localAddress` to be properly set before writing
debug output.

PR-URL: https://github.com/nodejs/node/pull/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>
canary-base
Brian White 8 years ago
committed by Ruben Bridgewater
parent
commit
2154a3ce0f
No known key found for this signature in database GPG Key ID: F07496B3EB3C1762
  1. 5
      lib/net.js

5
lib/net.js

@ -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);
@ -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);

Loading…
Cancel
Save