mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-26 03:27:31 +00:00
SSH2: more window size adjustments
This commit is contained in:
parent
b0090e2ebc
commit
8c9e7a890e
@ -2941,7 +2941,7 @@ class Net_SSH2 {
|
||||
$max_size = min(
|
||||
$this->packet_size_client_to_server[$client_channel],
|
||||
$this->window_size_client_to_server[$client_channel]
|
||||
);
|
||||
) - 4;
|
||||
while (strlen($data) > $max_size) {
|
||||
$packet = pack('CN2a*',
|
||||
NET_SSH2_MSG_CHANNEL_DATA,
|
||||
@ -2956,7 +2956,7 @@ class Net_SSH2 {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($max_size == $this->window_size_client_to_server[$client_channel]) {
|
||||
if ($max_size == $this->window_size_client_to_server[$client_channel] - 4) {
|
||||
$this->bitmap^= NET_SSH2_MASK_WINDOW_ADJUST;
|
||||
// using an invalid channel will let the buffers be built up for the valid channels
|
||||
$this->_get_channel_packet(-1);
|
||||
@ -2964,11 +2964,11 @@ class Net_SSH2 {
|
||||
$max_size = min(
|
||||
$this->packet_size_client_to_server[$client_channel],
|
||||
$this->window_size_client_to_server[$client_channel]
|
||||
);
|
||||
) - 4;
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen($data) >= $this->window_size_client_to_server[$client_channel]) {
|
||||
if (strlen($data) >= $this->window_size_client_to_server[$client_channel] - 4) {
|
||||
$this->bitmap^= NET_SSH2_MASK_WINDOW_ADJUST;
|
||||
$this->_get_channel_packet(-1);
|
||||
$this->bitmap^= NET_SSH2_MASK_WINDOW_ADJUST;
|
||||
|
Loading…
Reference in New Issue
Block a user