SSH2: timeout set in constructor != timeout set by setTimeout()

This commit is contained in:
terrafrost 2014-04-07 00:02:03 -05:00
parent fc748346fc
commit f27a49299e

View File

@ -801,6 +801,17 @@ class Net_SSH2
*/ */
var $port; var $port;
/**
* Timeout for Constructor
*
* For historical BC purposes setTimeout() does not effect timeout of constructor
*
* @see Net_SSH2::login()
* @var Integer
* @access private
*/
var $constructorTimeout
/** /**
* Default Constructor. * Default Constructor.
* *
@ -899,7 +910,7 @@ class Net_SSH2
$this->host = $host; $this->host = $host;
$this->port = $port; $this->port = $port;
$this->timeout = $timeout; $this->constructorTimeout = $timeout;
} }
/** /**
@ -910,7 +921,7 @@ class Net_SSH2
*/ */
function _connect() function _connect()
{ {
$timeout = $this->timeout; $timeout = $this->constructorTimeout;
$this->last_packet = strtok(microtime(), ' ') + strtok(''); // == microtime(true) in PHP5 $this->last_packet = strtok(microtime(), ' ') + strtok(''); // == microtime(true) in PHP5