SSH2: rm redundant code and make php4 compatable

This commit is contained in:
terrafrost 2015-03-19 22:39:43 -05:00
parent 23c65c3839
commit dfd57dfb89

View File

@ -991,8 +991,6 @@ class Net_SSH2
$temp = ''; $temp = '';
} }
$read = array($this->fsock);
if ($this->curTimeout) { if ($this->curTimeout) {
if ($this->curTimeout < 0) { if ($this->curTimeout < 0) {
$this->is_timeout = true; $this->is_timeout = true;
@ -1000,7 +998,7 @@ class Net_SSH2
} }
$read = array($this->fsock); $read = array($this->fsock);
$write = $except = null; $write = $except = null;
$start = microtime(true); $start = strtok(microtime(), ' ') + strtok('');
$sec = floor($this->curTimeout); $sec = floor($this->curTimeout);
$usec = 1000000 * ($this->curTimeout - $sec); $usec = 1000000 * ($this->curTimeout - $sec);
// on windows this returns a "Warning: Invalid CRT parameters detected" error // on windows this returns a "Warning: Invalid CRT parameters detected" error
@ -1009,7 +1007,7 @@ class Net_SSH2
$this->is_timeout = true; $this->is_timeout = true;
return false; return false;
} }
$elapsed = microtime(true) - $start; $elapsed = strtok(microtime(), ' ') + strtok('') - $start;
$this->curTimeout-= $elapsed; $this->curTimeout-= $elapsed;
} }