Destroy singleUse context right after it is going out of use.
Fix: https://github.com/iojs/io.js/issues/1522
PR-URL: https://github.com/iojs/io.js/pull/1529
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
}
// Do not keep read/write buffers in free list
- if (options.singleUse)
+ if (options.singleUse) {
+ c.singleUse = true;
c.context.setFreeListLength(0);
+ }
return c;
};
};
TLSSocket.prototype._destroySSL = function _destroySSL() {
- return this.ssl.destroySSL();
+ this.ssl.destroySSL();
+ if (this.ssl._secureContext.singleUse)
+ this.ssl._secureContext.context.close();
};
TLSSocket.prototype._init = function(socket, wrap) {