From 65dced730fa652675c8d92494220c135419bd419 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 28 Oct 2010 12:34:46 -0700 Subject: [PATCH] Handle one more onReadable call from crypto MUST get rid of this calledByIOWatcher stuff. Hopefully will be able to when securepair stuff lands. --- lib/net.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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;