Skip to content

Commit

Permalink
CryptoStream.prototype.destroySoon shouldn't die if not writable
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Mar 9, 2011
1 parent 161f7aa commit 62f06fb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/tls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
};


Expand Down

0 comments on commit 62f06fb

Please sign in to comment.