From f27a49299e5ff74d9a14c7855fb45a57adbbfa53 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Mon, 7 Apr 2014 00:02:03 -0500 Subject: [PATCH] SSH2: timeout set in constructor != timeout set by setTimeout() --- phpseclib/Net/SSH2.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 9a045e20..e96fc768 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -801,6 +801,17 @@ class Net_SSH2 */ 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. * @@ -899,7 +910,7 @@ class Net_SSH2 $this->host = $host; $this->port = $port; - $this->timeout = $timeout; + $this->constructorTimeout = $timeout; } /** @@ -910,7 +921,7 @@ class Net_SSH2 */ function _connect() { - $timeout = $this->timeout; + $timeout = $this->constructorTimeout; $this->last_packet = strtok(microtime(), ' ') + strtok(''); // == microtime(true) in PHP5