net: account encoding in .byteLength

This commit is contained in:
Fedor Indutny 2013-04-08 11:48:46 +04:00
parent e8c01739cd
commit ff32ecd5bf

View File

@ -667,7 +667,7 @@ Socket.prototype.__defineGetter__('bytesWritten', function() {
encoding = this._pendingEncoding; encoding = this._pendingEncoding;
state.buffer.forEach(function(el) { state.buffer.forEach(function(el) {
bytes += Buffer.byteLength(el.chunk); bytes += Buffer.byteLength(el.chunk, el.encoding);
}); });
if (data) if (data)