diff --git a/lib/tls.js b/lib/tls.js index 409d7da5c5..a7908f77fc 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -645,15 +645,18 @@ Object.defineProperty(CryptoStream.prototype, 'readyState', { function CleartextStream(pair, options) { CryptoStream.call(this, pair, options); + // This is a fake kludge to support how the http impl sits + // on top of net Sockets var self = this; this._handle = { readStop: function() { self._reading = false; }, readStart: function() { - if (self._reading) return; + if (self._reading && self._readableState.length > 0) return; self._reading = true; self.read(0); + if (self._opposite.readable) self._opposite.read(0); } }; }