diff --git a/lib/tls.js b/lib/tls.js index 5d04da59fe7..719a719bbf0 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -510,16 +510,11 @@ CryptoStream.prototype._read = function read(size) { if (this.ondata) { this.ondata(pool, start, start + bytesRead); - // Deceive streams2 - var self = this; + // Force state.reading to set to false + this.push(''); - setImmediate(function() { - // Force state.reading to set to false - self.push(''); - - // Try reading more, we most likely have some data - self.read(0); - }); + // Try reading more, we most likely have some data + this.read(0); } else { this.push(pool.slice(start, start + bytesRead)); }