diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2011-12-12 13:45:39 -0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-12-12 13:45:44 -0800 |
commit | 8295c806181654fc6bbc8845c727b7378a196304 (patch) | |
tree | 18f35c6f8f8c0a78f819e68b02060ae7978509ed | |
parent | e698dd38c3996199c47c944de873e368dce42608 (diff) | |
download | node-new-8295c806181654fc6bbc8845c727b7378a196304.tar.gz |
net: check status code in afterWrite
Fixes memory leak and spin on writing to dead fds. This was tested in
production.
-rw-r--r-- | lib/net.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/net.js b/lib/net.js index 19858e80df..e182173953 100644 --- a/lib/net.js +++ b/lib/net.js @@ -465,7 +465,11 @@ function afterWrite(status, handle, req, buffer) { if (self.destroyed) { return; } - // TODO check status. + + if (status) { + self.destroy(errnoException(errno, 'write')); + return; + } timers.active(this); |