This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fix OpenSSL 100% CPU usage on error

  • Loading branch information...
brainfucker authored and ry committed Jul 18, 2010
1 parent ff953dc commit cde80d9859b57a5652085e700845582ea2f86d3a
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/net.js
View
@@ -515,6 +515,11 @@ function initStream (self) {
// Optimization: emit the original buffer with end points
if (self.ondata) self.ondata(pool, start, end);
+ } else if (bytesRead == -2) {
+ // Temporary fix - need SSL refactor.
+ // -2 originates from SecureStream::ReadExtract
+ self.destroy(new Error('openssl read error'));
+ return false;
}
};
self.readable = false;

0 comments on commit cde80d9

Please sign in to comment.