CryptoStream.prototype.destroySoon shouldn't die if not writable

This commit is contained in:
Ryan Dahl 2011-03-09 10:53:06 -08:00
parent 161f7aacf7
commit 62f06fb885

View File

@ -170,7 +170,11 @@ CryptoStream.prototype.end = function(d) {
CryptoStream.prototype.destroySoon = function(err) {
return this.end();
if (this.writable) {
this.end();
} else {
this.destroy();
}
};