mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-27 19:54:57 +00:00
Merge branch '3.0'
This commit is contained in:
commit
f5a6d02217
@ -347,7 +347,7 @@ class SFTP extends SSH2
|
|||||||
*/
|
*/
|
||||||
private function partial_init_sftp_connection(): bool
|
private function partial_init_sftp_connection(): bool
|
||||||
{
|
{
|
||||||
$response = $this->openChannel(self::CHANNEL, true);
|
$response = $this->open_channel(self::CHANNEL, true);
|
||||||
if ($response === true && $this->isTimeout()) {
|
if ($response === true && $this->isTimeout()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -2540,7 +2540,7 @@ class SSH2
|
|||||||
// throw new RuntimeException('If you want to run multiple exec()\'s you will need to disable (and re-enable if appropriate) a PTY for each one.');
|
// throw new RuntimeException('If you want to run multiple exec()\'s you will need to disable (and re-enable if appropriate) a PTY for each one.');
|
||||||
//}
|
//}
|
||||||
|
|
||||||
$this->openChannel(self::CHANNEL_EXEC);
|
$this->open_channel(self::CHANNEL_EXEC);
|
||||||
|
|
||||||
if ($this->request_pty === true) {
|
if ($this->request_pty === true) {
|
||||||
$terminal_modes = pack('C', TerminalMode::TTY_OP_END);
|
$terminal_modes = pack('C', TerminalMode::TTY_OP_END);
|
||||||
@ -2633,7 +2633,7 @@ class SSH2
|
|||||||
/**
|
/**
|
||||||
* Opens a channel
|
* Opens a channel
|
||||||
*/
|
*/
|
||||||
protected function openChannel(int $channel, bool $skip_extended = false): bool
|
protected function open_channel(int $channel, bool $skip_extended = false): bool
|
||||||
{
|
{
|
||||||
if (isset($this->channel_status[$channel]) && $this->channel_status[$channel] != MessageType::CHANNEL_CLOSE) {
|
if (isset($this->channel_status[$channel]) && $this->channel_status[$channel] != MessageType::CHANNEL_CLOSE) {
|
||||||
throw new RuntimeException('Please close the channel (' . $channel . ') before trying to open it again');
|
throw new RuntimeException('Please close the channel (' . $channel . ') before trying to open it again');
|
||||||
@ -2689,7 +2689,7 @@ class SSH2
|
|||||||
throw new InsufficientSetupException('Operation disallowed prior to login()');
|
throw new InsufficientSetupException('Operation disallowed prior to login()');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->openChannel(self::CHANNEL_SHELL);
|
$this->open_channel(self::CHANNEL_SHELL);
|
||||||
|
|
||||||
$terminal_modes = pack('C', TerminalMode::TTY_OP_END);
|
$terminal_modes = pack('C', TerminalMode::TTY_OP_END);
|
||||||
$packet = Strings::packSSH2(
|
$packet = Strings::packSSH2(
|
||||||
@ -2926,7 +2926,7 @@ class SSH2
|
|||||||
*/
|
*/
|
||||||
public function startSubsystem(string $subsystem): bool
|
public function startSubsystem(string $subsystem): bool
|
||||||
{
|
{
|
||||||
$this->openChannel(self::CHANNEL_SUBSYSTEM);
|
$this->open_channel(self::CHANNEL_SUBSYSTEM);
|
||||||
|
|
||||||
$packet = Strings::packSSH2(
|
$packet = Strings::packSSH2(
|
||||||
'CNsCs',
|
'CNsCs',
|
||||||
@ -3048,7 +3048,7 @@ class SSH2
|
|||||||
if ($level == 1) {
|
if ($level == 1) {
|
||||||
$this->send_binary_packet(pack('CN', NET_SSH2_MSG_IGNORE, 0));
|
$this->send_binary_packet(pack('CN', NET_SSH2_MSG_IGNORE, 0));
|
||||||
} else {
|
} else {
|
||||||
$this->openChannel(self::CHANNEL_KEEP_ALIVE);
|
$this->open_channel(self::CHANNEL_KEEP_ALIVE);
|
||||||
$this->close_channel(self::CHANNEL_KEEP_ALIVE);
|
$this->close_channel(self::CHANNEL_KEEP_ALIVE);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -3117,7 +3117,7 @@ class SSH2
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->openChannel(self::CHANNEL_KEEP_ALIVE);
|
$this->open_channel(self::CHANNEL_KEEP_ALIVE);
|
||||||
} catch (\RuntimeException $e) {
|
} catch (\RuntimeException $e) {
|
||||||
return $this->reconnect();
|
return $this->reconnect();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user