From d83c9a30d219aa66b24cf1177f2ae8339d4a2ce4 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 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 0247eeac747bbf..8aa4860e1177d8 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -281,7 +281,14 @@ TLSSocket.prototype._wrapHandle = function(handle) { tls.createSecureContext(); res = tls_wrap.wrap(handle, context.context, options.isServer); res._parent = handle; - res.reading = handle.reading; + Object.defineProperty(res, 'reading', { + get: function readingGetter() { + return handle.reading; + }, + set: function readingSetter(value) { + handle.reading = value; + } + }); // Proxy HandleWrap, PipeWrap and TCPWrap methods proxiedMethods.forEach(function(name) {