1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-12-03 10:08:04 +01:00

Merge branch '1.0' into 2.0

This commit is contained in:
terrafrost 2023-03-05 04:18:37 -06:00
commit 7ce104b12c
2 changed files with 20 additions and 0 deletions

View File

@ -2860,6 +2860,16 @@ class SSH2
return $this->_disconnect(NET_SSH2_DISCONNECT_BY_APPLICATION);
}
/**
* Return the currently configured timeout
*
* @return int
*/
function getTimeout()
{
return $this->timeout;
}
/**
* Set Timeout
*

View File

@ -110,6 +110,16 @@ class Unit_Net_SSH2UnitTest extends PhpseclibTestCase
$this->assertFalse($ssh->isQuietModeEnabled());
}
public function testGetTimeout()
{
$ssh = new Net_SSH2('localhost');
$this->assertEquals(10, $ssh->getTimeout());
$ssh->setTimeout(0);
$this->assertEquals(0, $ssh->getTimeout());
$ssh->setTimeout(20);
$this->assertEquals(20, $ssh->getTimeout());
}
/**
* @return \phpseclib\Net\SSH2
*/