summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2011-12-12 13:45:39 -0800
committerRyan Dahl <ry@tinyclouds.org>2011-12-12 13:45:44 -0800
commit8295c806181654fc6bbc8845c727b7378a196304 (patch)
tree18f35c6f8f8c0a78f819e68b02060ae7978509ed
parente698dd38c3996199c47c944de873e368dce42608 (diff)
downloadnode-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.js6
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);