mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-27 03:42:40 +00:00
SSH2: attempt to handle case where window size is smaller than packet size
This commit is contained in:
parent
327a3b8bc8
commit
309f79ecea
@ -2928,12 +2928,16 @@ class Net_SSH2 {
|
||||
*/
|
||||
function _send_channel_packet($client_channel, $data)
|
||||
{
|
||||
while (strlen($data) > $this->packet_size_client_to_server[$client_channel]) {
|
||||
$max_size = min(
|
||||
$this->packet_size_client_to_server[$client_channel],
|
||||
$this->window_size_client_to_server[$client_channel]
|
||||
);
|
||||
while (strlen($data) > $max_size) {
|
||||
$packet = pack('CN2a*',
|
||||
NET_SSH2_MSG_CHANNEL_DATA,
|
||||
$this->server_channels[$client_channel],
|
||||
$this->packet_size_client_to_server[$client_channel],
|
||||
$this->_string_shift($data, $this->packet_size_client_to_server[$client_channel])
|
||||
$max_size,
|
||||
$this->_string_shift($data, $max_size)
|
||||
);
|
||||
|
||||
if (!$this->_send_binary_packet($packet)) {
|
||||
|
Loading…
Reference in New Issue
Block a user