Skip to content

Instantly share code, notes, and snippets.

@nodesocket
Created September 29, 2011 00:14
Show Gist options
  • Save nodesocket/1249665 to your computer and use it in GitHub Desktop.
Save nodesocket/1249665 to your computer and use it in GitHub Desktop.
diff --git a/lib/net.js b/lib/net.js
index 4af00b4..9565b38 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -350,8 +350,9 @@ Socket.prototype.write = function(data /* [encoding], [fd], [cb] */) {
this._writeQueueCallbacks[last] = cb;
} else {
// awful
+ var original = this._writeQueueCallbacks[last];
this._writeQueueCallbacks[last] = function() {
- this._writeQueueCallbacks[last]();
+ original();
cb();
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment