Browse Source

lint

v0.10.5-release
isaacs 12 years ago
parent
commit
22c7d134e2
  1. 6
      lib/cluster.js
  2. 3
      lib/net.js

6
lib/cluster.js

@ -142,9 +142,9 @@ cluster.setupMaster = function(options) {
var INTERNAL_PREFIX = 'NODE_CLUSTER_'; var INTERNAL_PREFIX = 'NODE_CLUSTER_';
function isInternalMessage(message) { function isInternalMessage(message) {
return isObject(message) && return isObject(message) &&
typeof message.cmd === 'string' && typeof message.cmd === 'string' &&
message.cmd.length > INTERNAL_PREFIX.length && message.cmd.length > INTERNAL_PREFIX.length &&
message.cmd.slice(0, INTERNAL_PREFIX.length) === INTERNAL_PREFIX; message.cmd.slice(0, INTERNAL_PREFIX.length) === INTERNAL_PREFIX;
} }
// Modify message object to be internal // Modify message object to be internal

3
lib/net.js

@ -673,11 +673,12 @@ Socket.prototype.__defineGetter__('bytesWritten', function() {
bytes += Buffer.byteLength(el.chunk, el.encoding); bytes += Buffer.byteLength(el.chunk, el.encoding);
}); });
if (data) if (data) {
if (Buffer.isBuffer(data)) if (Buffer.isBuffer(data))
bytes += data.length; bytes += data.length;
else else
bytes += Buffer.byteLength(data, encoding); bytes += Buffer.byteLength(data, encoding);
}
return bytes; return bytes;
}); });

Loading…
Cancel
Save