From cde80d9859b57a5652085e700845582ea2f86d3a Mon Sep 17 00:00:00 2001 From: Illarionov Oleg Date: Sun, 18 Jul 2010 12:52:09 +0400 Subject: [PATCH] Fix OpenSSL 100% CPU usage on error --- lib/net.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/net.js b/lib/net.js index 63422a273a..3469e82606 100644 --- a/lib/net.js +++ b/lib/net.js @@ -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;