From 1d59927ab4f1ee63680e0064afd8d8793dccc594 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Sat, 28 Feb 2015 21:14:07 +0300 Subject: [PATCH] tls: proxy `handle.reading` back to parent handle Fix: https://github.com/iojs/io.js/issues/995 --- lib/_tls_wrap.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 0247eeac747bbf..3559f961e65cb8 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -282,6 +282,14 @@ TLSSocket.prototype._wrapHandle = function(handle) { res = tls_wrap.wrap(handle, context.context, options.isServer); res._parent = handle; res.reading = handle.reading; + Object.defineProperty(handle, 'reading', { + get: function readingGetter() { + return res.reading; + }, + set: function readingSetter(value) { + res.reading = value; + } + }); // Proxy HandleWrap, PipeWrap and TCPWrap methods proxiedMethods.forEach(function(name) {