Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
net: move debug statement
This will allow `localAddress` to be properly set before writing
debug output.
  • Loading branch information
mscdex committed Apr 24, 2017
commit 212f72165ee817ccd39cc6685f6a1e418d4b0489
7 changes: 4 additions & 3 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -859,14 +859,15 @@ 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';
debug('binding to localAddress: %s and localPort: %d (addressType: 4)',
localAddress, localPort);
err = self._handle.bind(localAddress, localPort);
} else if (addressType === 6) {
localAddress = localAddress || '::';
debug('binding to localAddress: %s and localPort: %d (addressType: 6)',
localAddress, localPort);
err = self._handle.bind6(localAddress, localPort);
} else {
self._destroy(new TypeError('Invalid addressType: ' + addressType));
Expand Down