mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-11 16:15:52 +00:00
- exit-status's sent before channel data no longer produce empty output
This commit is contained in:
parent
2306b73677
commit
9d0b172103
@ -2224,8 +2224,10 @@ class Net_SSH2 {
|
|||||||
case 'exit-status':
|
case 'exit-status':
|
||||||
// "The channel needs to be closed with SSH_MSG_CHANNEL_CLOSE after this message."
|
// "The channel needs to be closed with SSH_MSG_CHANNEL_CLOSE after this message."
|
||||||
// -- http://tools.ietf.org/html/rfc4254#section-6.10
|
// -- http://tools.ietf.org/html/rfc4254#section-6.10
|
||||||
$this->_close_channel($client_channel);
|
$this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_EOF, $this->server_channels[$client_channel]));
|
||||||
return true;
|
$this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_CLOSE, $this->server_channels[$channel]));
|
||||||
|
|
||||||
|
$this->channel_status[$channel] = NET_SSH2_MSG_CHANNEL_EOF;
|
||||||
default:
|
default:
|
||||||
// "Some systems may not implement signals, in which case they SHOULD ignore this message."
|
// "Some systems may not implement signals, in which case they SHOULD ignore this message."
|
||||||
// -- http://tools.ietf.org/html/rfc4254#section-6.9
|
// -- http://tools.ietf.org/html/rfc4254#section-6.9
|
||||||
@ -2233,7 +2235,16 @@ class Net_SSH2 {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NET_SSH2_MSG_CHANNEL_CLOSE:
|
case NET_SSH2_MSG_CHANNEL_CLOSE:
|
||||||
|
$this->curTimeout = 0;
|
||||||
|
|
||||||
|
if ($this->bitmap & NET_SSH2_MASK_SHELL) {
|
||||||
|
$this->bitmap&= ~NET_SSH2_MASK_SHELL;
|
||||||
|
}
|
||||||
|
if ($this->channel_status[$channel] != NET_SSH2_MSG_CHANNEL_EOF) {
|
||||||
$this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_CLOSE, $this->server_channels[$channel]));
|
$this->_send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_CLOSE, $this->server_channels[$channel]));
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->channel_status[$channel] = NET_SSH2_MSG_CHANNEL_CLOSE;
|
||||||
return true;
|
return true;
|
||||||
case NET_SSH2_MSG_CHANNEL_EOF:
|
case NET_SSH2_MSG_CHANNEL_EOF:
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user