Merge branch '0.0' into 2.0

This commit is contained in:
terrafrost 2022-01-28 00:52:05 -06:00
commit ef45ea7289

View File

@ -1294,8 +1294,8 @@ class SSH2
$read = array($this->fsock); $read = array($this->fsock);
$write = $except = null; $write = $except = null;
$start = microtime(true); $start = microtime(true);
$sec = floor($this->curTimeout); $sec = (int) floor($this->curTimeout);
$usec = 1000000 * ($this->curTimeout - $sec); $usec = (int) (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
// the !count() is done as a workaround for <https://bugs.php.net/42682> // the !count() is done as a workaround for <https://bugs.php.net/42682>
if (!@stream_select($read, $write, $except, $sec, $usec) && !count($read)) { if (!@stream_select($read, $write, $except, $sec, $usec) && !count($read)) {
@ -1310,6 +1310,7 @@ class SSH2
if (strlen($temp) == 255) { if (strlen($temp) == 255) {
continue; continue;
} }
if ($temp === false) { if ($temp === false) {
return false; return false;
} }
@ -3503,8 +3504,8 @@ class SSH2
$this->curTimeout-= $elapsed; $this->curTimeout-= $elapsed;
} }
$sec = floor($this->curTimeout); $sec = (int)floor($this->curTimeout);
$usec = 1000000 * ($this->curTimeout - $sec); $usec = (int)(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
if (!@stream_select($read, $write, $except, $sec, $usec) && !count($read)) { if (!@stream_select($read, $write, $except, $sec, $usec) && !count($read)) {