diff --git a/lib/cluster.js b/lib/cluster.js index 5245ab02a4..44dd2e5d2a 100644 --- a/lib/cluster.js +++ b/lib/cluster.js @@ -142,9 +142,9 @@ cluster.setupMaster = function(options) { var INTERNAL_PREFIX = 'NODE_CLUSTER_'; function isInternalMessage(message) { return isObject(message) && - typeof message.cmd === 'string' && - message.cmd.length > INTERNAL_PREFIX.length && - message.cmd.slice(0, INTERNAL_PREFIX.length) === INTERNAL_PREFIX; + typeof message.cmd === 'string' && + message.cmd.length > INTERNAL_PREFIX.length && + message.cmd.slice(0, INTERNAL_PREFIX.length) === INTERNAL_PREFIX; } // Modify message object to be internal diff --git a/lib/net.js b/lib/net.js index b5a1a62328..646983f6ca 100644 --- a/lib/net.js +++ b/lib/net.js @@ -673,11 +673,12 @@ Socket.prototype.__defineGetter__('bytesWritten', function() { bytes += Buffer.byteLength(el.chunk, el.encoding); }); - if (data) + if (data) { if (Buffer.isBuffer(data)) bytes += data.length; else bytes += Buffer.byteLength(data, encoding); + } return bytes; });