0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

net: check status code in afterWrite

Fixes memory leak and spin on writing to dead fds. This was tested in
production.
This commit is contained in:
Ben Noordhuis 2011-12-12 13:45:39 -08:00 committed by Ryan Dahl
parent e698dd38c3
commit 8295c80618

View File

@ -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);