tls: destroy singleUse context immediately
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>
This commit is contained in:
parent
2684c902c4
commit
1787416376
@ -134,8 +134,10 @@ exports.createSecureContext = function createSecureContext(options, context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do not keep read/write buffers in free list
|
// Do not keep read/write buffers in free list
|
||||||
if (options.singleUse)
|
if (options.singleUse) {
|
||||||
|
c.singleUse = true;
|
||||||
c.context.setFreeListLength(0);
|
c.context.setFreeListLength(0);
|
||||||
|
}
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
};
|
};
|
||||||
|
@ -301,7 +301,9 @@ TLSSocket.prototype._wrapHandle = function(handle) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
TLSSocket.prototype._destroySSL = function _destroySSL() {
|
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) {
|
TLSSocket.prototype._init = function(socket, wrap) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user