Browse Source

Fix GH-820. CryptoStream.end shouldn't throw if not writable

This matches the behavior of net.Socket
v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
7e28630f5e
  1. 6
      lib/tls.js

6
lib/tls.js

@ -168,10 +168,7 @@ CryptoStream.prototype.getCipher = function(err) {
CryptoStream.prototype.end = function(d) {
if (!this.writable) {
throw new Error('CryptoStream is not writable');
}
if (this.writable) {
if (this.pair._done) return;
if (d) {
@ -187,6 +184,7 @@ CryptoStream.prototype.end = function(d) {
this.writable = false;
this.pair._cycle();
}
};

Loading…
Cancel
Save