Skip to content

Instantly share code, notes, and snippets.

@isaacs isaacs/gist:5332979
Created Apr 7, 2013

Embed
What would you like to do?
diff --git a/lib/net.js b/lib/net.js
index 4b2622b..3c58de2 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -667,7 +667,7 @@ Socket.prototype.__defineGetter__('bytesWritten', function() {
encoding = this._pendingEncoding;
state.buffer.forEach(function(el) {
- bytes += Buffer.byteLength(el.chunk);
+ bytes += Buffer.byteLength(el.chunk, el.encoding);
});
if (data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.