ssh2
Advanced tools
Comparing version 0.2.15 to 0.2.16
@@ -596,3 +596,3 @@ var inherits = require('util').inherits, | ||
break; | ||
else | ||
else if (this._channel) | ||
ret = this._channel._sendData(this._outbuffer[i][0], this._outbuffer[i][1]); | ||
@@ -620,2 +620,4 @@ } | ||
throw new Error('ChannelStream is not writable'); | ||
else if (!this._channel) | ||
return true; | ||
@@ -655,3 +657,4 @@ var extendedType; | ||
this.paused = true; | ||
this._channel._conn._sock.pause(); | ||
if (this._channel) | ||
this._channel._conn._sock.pause(); | ||
}; | ||
@@ -662,3 +665,4 @@ | ||
this._drainInBuffer(); | ||
this._channel._conn._sock.resume(); | ||
if (this._channel) | ||
this._channel._conn._sock.resume(); | ||
}; | ||
@@ -669,3 +673,3 @@ | ||
return; | ||
var ret; | ||
var ret = true; | ||
if (data && data.length) | ||
@@ -677,6 +681,8 @@ ret = this.write(data, encoding, extended); | ||
} else { | ||
ret = this._channel.eof(); | ||
if (this._channel) | ||
ret = this._channel.eof(); | ||
this.writable = false; | ||
if (!this.allowHalfOpen) { | ||
ret = this._channel.close(); | ||
if (this._channel) | ||
ret = this._channel.close(); | ||
this.readable = false; | ||
@@ -690,5 +696,7 @@ } | ||
ChannelStream.prototype.destroy = function() { | ||
var ret; | ||
ret = this._channel.eof(); | ||
ret = this._channel.close(); | ||
var ret = true; | ||
if (this._channel) { | ||
ret = this._channel.eof(); | ||
ret = this._channel.close(); | ||
} | ||
this._cleanup(); | ||
@@ -703,4 +711,6 @@ return ret; | ||
this._inbuffer = []; | ||
this._channel._conn._sock.removeListener('end', this._sockOnEnd); | ||
this._channel._conn._sock.removeListener('close', this._sockOnEnd); | ||
if (this._channel) { | ||
this._channel._conn._sock.removeListener('end', this._sockOnEnd); | ||
this._channel._conn._sock.removeListener('close', this._sockOnEnd); | ||
} | ||
this.writable = false; | ||
@@ -707,0 +717,0 @@ this.readable = false; |
{ "name": "ssh2", | ||
"version": "0.2.15", | ||
"version": "0.2.16", | ||
"author": "Brian White <mscdex@mscdex.net>", | ||
@@ -4,0 +4,0 @@ "description": "An SSH2 client module written in pure JavaScript for node.js", |
276329
5611