mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-28 12:10:59 +00:00
SSH2: make exceptions more useful for read() / write()
This commit is contained in:
parent
06f45881f9
commit
f664ccb521
@ -3063,6 +3063,10 @@ class SSH2
|
|||||||
*/
|
*/
|
||||||
public function read($expect = '', $mode = self::READ_SIMPLE, $channel = null)
|
public function read($expect = '', $mode = self::READ_SIMPLE, $channel = null)
|
||||||
{
|
{
|
||||||
|
if (!$this->isAuthenticated()) {
|
||||||
|
throw new InsufficientSetupException('Operation disallowed prior to login()');
|
||||||
|
}
|
||||||
|
|
||||||
$this->curTimeout = $this->timeout;
|
$this->curTimeout = $this->timeout;
|
||||||
$this->is_timeout = false;
|
$this->is_timeout = false;
|
||||||
|
|
||||||
@ -3120,6 +3124,10 @@ class SSH2
|
|||||||
*/
|
*/
|
||||||
public function write($cmd, $channel = null)
|
public function write($cmd, $channel = null)
|
||||||
{
|
{
|
||||||
|
if (!$this->isAuthenticated()) {
|
||||||
|
throw new InsufficientSetupException('Operation disallowed prior to login()');
|
||||||
|
}
|
||||||
|
|
||||||
if ($channel === null) {
|
if ($channel === null) {
|
||||||
$channel = $this->get_interactive_channel();
|
$channel = $this->get_interactive_channel();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user