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_';
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

3
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;
});

Loading…
Cancel
Save