diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2011-10-15 03:10:53 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2011-10-15 03:24:34 +0200 |
commit | 6df574b744f376b18a6697595717c9fd6abd59e9 (patch) | |
tree | 03ff6ed24d8c6e71714c8ef7bff2602643e028c6 /lib | |
parent | 971c3d90eb1140dc6a5a0df09f7c375ead28d8de (diff) | |
download | android-node-v8-6df574b744f376b18a6697595717c9fd6abd59e9.tar.gz android-node-v8-6df574b744f376b18a6697595717c9fd6abd59e9.tar.bz2 android-node-v8-6df574b744f376b18a6697595717c9fd6abd59e9.zip |
net: properly account multi-byte chars in .bytesWritten
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/net.js b/lib/net.js index 8404d6f44c..cb8e25ed60 100644 --- a/lib/net.js +++ b/lib/net.js @@ -381,13 +381,13 @@ Socket.prototype.write = function(data, arg1, arg2) { } } - this.bytesWritten += data.length; - // Change strings to buffers. SLOW if (typeof data == 'string') { data = new Buffer(data, encoding); } + this.bytesWritten += data.length; + // If we are still connecting, then buffer this for later. if (this._connecting) { this._connectQueueSize += data.length; |