mirror of https://github.com/nodejs/node.git
tls: use parent handle's close callback
When closing the child TLSWrap handle - wait for the proper parent's handle close callback invocation. `uv_close_cb` may be invoked much later than the next libuv tick, depending on the platform. The only platform that currently seem to defer `uv_close_cb` is Windows XP. This behavior was not observed on other Windows systems, and is not possible on Unixes. Fix: https://github.com/nodejs/node/issues/2979 PR-URL: https://github.com/nodejs/node/pull/2991 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>pull/3329/head
parent
a713024579
commit
51325c03d4
|
@ -296,7 +296,7 @@ proxiedMethods.forEach(function(name) {
|
||||||
|
|
||||||
tls_wrap.TLSWrap.prototype.close = function closeProxy(cb) {
|
tls_wrap.TLSWrap.prototype.close = function closeProxy(cb) {
|
||||||
if (this._parentWrap && this._parentWrap._handle === this._parent) {
|
if (this._parentWrap && this._parentWrap._handle === this._parent) {
|
||||||
setImmediate(cb);
|
this._parentWrap.once('close', cb);
|
||||||
return this._parentWrap.destroy();
|
return this._parentWrap.destroy();
|
||||||
}
|
}
|
||||||
return this._parent.close(cb);
|
return this._parent.close(cb);
|
||||||
|
|
Loading…
Reference in New Issue