diff --git a/lib/net.js b/lib/net.js index ca5dade1d..ee2d82280 100644 --- a/lib/net.js +++ b/lib/net.js @@ -168,7 +168,7 @@ function setImplmentationMethods (self) { if (secureLen == -1) { // Check our read again for secure handshake - self._readWatcher.callback(); + self._onReadable(); } else { oldWrite(securePool, 0, secureLen, fd, flags); } @@ -215,7 +215,7 @@ function setImplmentationMethods (self) { if (self.secureStream.clearPending()) { process.nextTick(function () { - if (self.readable) self._onReadable(true); + if (self.readable) self._onReadable(); }); } @@ -275,7 +275,7 @@ function setImplmentationMethods (self) { function onReadable (readable, writeable) { assert(this.socket); var socket = this.socket; - socket._onReadable(); + socket._onReadable(true); } @@ -704,7 +704,7 @@ Stream.prototype._onWritable = function () { }; -Stream.prototype._onReadable = function () { +Stream.prototype._onReadable = function (calledByIOWatcher) { var self = this; // If this is the first recv (pool doesn't exist) or we've used up @@ -723,7 +723,7 @@ Stream.prototype._onReadable = function () { bytesRead = self._readImpl(pool, pool.used, pool.length - pool.used, - !arguments[0] /* stupid calledByIOWatcher shit */); + calledByIOWatcher); } catch (e) { self.destroy(e); return;