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

Commit

Permalink
net_uv: handle read errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Aug 22, 2011
1 parent b8d40be commit cf2e68d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/net_uv.js
Expand Up @@ -300,7 +300,7 @@ function onread(buffer, offset, length) {
// Optimization: emit the original buffer with end points
if (self.ondata) self.ondata(buffer, offset, end);

} else {
} else if (errno == 'EOF') {
// EOF
self.readable = false;

Expand All @@ -314,6 +314,9 @@ function onread(buffer, offset, length) {
if (!self.allowHalfOpen) self.end();
if (self._events && self._events['end']) self.emit('end');
if (self.onend) self.onend();
} else {
// Error
self.destroy(errnoException(errno, 'read'));
}
}

Expand Down

0 comments on commit cf2e68d

Please sign in to comment.