Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
net: check status code in afterWrite
Browse files Browse the repository at this point in the history
Fixes memory leak and spin on writing to dead fds. This was tested in
production.
  • Loading branch information
bnoordhuis authored and ry committed Dec 12, 2011
1 parent e698dd3 commit 8295c80
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/net.js
Expand Up @@ -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);

Expand Down

0 comments on commit 8295c80

Please sign in to comment.