1
0
mirror of https://github.com/danog/tgseclib.git synced 2025-01-22 14:01:20 +01:00

Merge branch '2.0'

This commit is contained in:
terrafrost 2019-01-20 09:17:57 -06:00
commit c03753e3c7

View File

@ -109,6 +109,7 @@ class SSH2
const CHANNEL_SHELL = 2; const CHANNEL_SHELL = 2;
const CHANNEL_SUBSYSTEM = 3; const CHANNEL_SUBSYSTEM = 3;
const CHANNEL_AGENT_FORWARD = 4; const CHANNEL_AGENT_FORWARD = 4;
const CHANNEL_KEEP_ALIVE = 5;
/**#@-*/ /**#@-*/
/**#@+ /**#@+
@ -3321,24 +3322,24 @@ class SSH2
return false; return false;
} }
$this->window_size_server_to_client[NET_SSH2_CHANNEL_KEEP_ALIVE] = $this->window_size; $this->window_size_server_to_client[self::CHANNEL_KEEP_ALIVE] = $this->window_size;
$packet_size = 0x4000; $packet_size = 0x4000;
$packet = pack( $packet = pack(
'CNa*N3', 'CNa*N3',
NET_SSH2_MSG_CHANNEL_OPEN, NET_SSH2_MSG_CHANNEL_OPEN,
strlen('session'), strlen('session'),
'session', 'session',
NET_SSH2_CHANNEL_KEEP_ALIVE, self::CHANNEL_KEEP_ALIVE,
$this->window_size_server_to_client[NET_SSH2_CHANNEL_KEEP_ALIVE], $this->window_size_server_to_client[self::CHANNEL_KEEP_ALIVE],
$packet_size $packet_size
); );
try { try {
$this->send_binary_packet($packet); $this->send_binary_packet($packet);
$this->channel_status[NET_SSH2_CHANNEL_KEEP_ALIVE] = NET_SSH2_MSG_CHANNEL_OPEN; $this->channel_status[self::CHANNEL_KEEP_ALIVE] = NET_SSH2_MSG_CHANNEL_OPEN;
$response = $this->get_channel_packet(NET_SSH2_CHANNEL_KEEP_ALIVE); $response = $this->get_channel_packet(self::CHANNEL_KEEP_ALIVE);
} catch (\RuntimeException $e) { } catch (\RuntimeException $e) {
return $this->reconnect(); return $this->reconnect();
} }