This commit is contained in:
isaacs 2013-04-11 11:06:07 -07:00
parent 50be39792a
commit 22c7d134e2
2 changed files with 5 additions and 4 deletions

View File

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