mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-11 08:10:58 +00:00
SSH2: update ping method to work with exceptions
This commit is contained in:
parent
c1493a8063
commit
8705f4b31e
@ -3300,19 +3300,18 @@ class SSH2
|
|||||||
$packet_size
|
$packet_size
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!@$this->send_binary_packet($packet)) {
|
try {
|
||||||
return $this->reconnect();
|
$this->send_binary_packet($packet);
|
||||||
}
|
|
||||||
|
|
||||||
$this->channel_status[NET_SSH2_CHANNEL_KEEP_ALIVE] = NET_SSH2_MSG_CHANNEL_OPEN;
|
$this->channel_status[NET_SSH2_CHANNEL_KEEP_ALIVE] = NET_SSH2_MSG_CHANNEL_OPEN;
|
||||||
|
|
||||||
$response = @$this->get_channel_packet(NET_SSH2_CHANNEL_KEEP_ALIVE);
|
$response = $this->get_channel_packet(NET_SSH2_CHANNEL_KEEP_ALIVE);
|
||||||
if ($response !== false) {
|
} catch (\RuntimeException $e) {
|
||||||
$this->close_channel(NET_SSH2_CHANNEL_KEEP_ALIVE);
|
return $this->reconnect();
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->reconnect();
|
$this->close_channel(NET_SSH2_CHANNEL_KEEP_ALIVE);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user