- send a NET_SSH2_MSG_CHANNEL_CLOSE packet in addition to a NET_SSH2_MSG_CHANNEL_EOF packet when force closing the channel (thanks, ferus!)

git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@197 21d32557-59b3-4da0-833f-c5933fad653e
This commit is contained in:
Jim Wigginton 2012-03-05 02:06:13 +00:00
parent 6d3e3dd12e
commit 329d3e2a15

View File

@ -2123,9 +2123,7 @@ class Net_SSH2 {
return $this->_disconnect(NET_SSH2_DISCONNECT_BY_APPLICATION); return $this->_disconnect(NET_SSH2_DISCONNECT_BY_APPLICATION);
} }
case NET_SSH2_MSG_CHANNEL_CLOSE: case NET_SSH2_MSG_CHANNEL_CLOSE:
$this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_CLOSE, $this->server_channels[$channel])); return $type == NET_SSH2_MSG_CHANNEL_CLOSE ? true : $this->_get_channel_packet($client_channel, $skip_extended);
return $type != NET_SSH2_MSG_CHANNEL_CLOSE;
} }
switch ($type) { switch ($type) {
@ -2350,12 +2348,9 @@ class Net_SSH2 {
{ {
// see http://tools.ietf.org/html/rfc4254#section-5.3 // see http://tools.ietf.org/html/rfc4254#section-5.3
$packet = pack('CN', $this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_EOF, $this->server_channels[$channel]));
NET_SSH2_MSG_CHANNEL_EOF,
$this->server_channels[$client_channel]); $this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_CLOSE, $this->server_channels[$channel]));
if (!$this->_send_binary_packet($packet)) {
return false;
}
$this->channel_status[$client_channel] = NET_SSH2_MSG_CHANNEL_CLOSE; $this->channel_status[$client_channel] = NET_SSH2_MSG_CHANNEL_CLOSE;