mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-13 18:02:58 +00:00
Fix: avoid warn when cast float to int in PHP7.1.
I got some error. ``` Implicit conversion from float 992216.1102294922 to int loses precision --- ```
This commit is contained in:
parent
b2708aa783
commit
ba4414c2f3
@ -1331,8 +1331,8 @@ class Net_SSH2
|
||||
$read = array($this->fsock);
|
||||
$write = $except = null;
|
||||
$start = strtok(microtime(), ' ') + strtok('');
|
||||
$sec = floor($this->curTimeout);
|
||||
$usec = 1000000 * ($this->curTimeout - $sec);
|
||||
$sec = (int) floor($this->curTimeout);
|
||||
$usec = (int) (1000000 * ($this->curTimeout - $sec));
|
||||
// on windows this returns a "Warning: Invalid CRT parameters detected" error
|
||||
// the !count() is done as a workaround for <https://bugs.php.net/42682>
|
||||
if (!@stream_select($read, $write, $except, $sec, $usec) && !count($read)) {
|
||||
@ -3518,8 +3518,8 @@ class Net_SSH2
|
||||
$this->curTimeout-= $elapsed;
|
||||
}
|
||||
|
||||
$sec = floor($this->curTimeout);
|
||||
$usec = 1000000 * ($this->curTimeout - $sec);
|
||||
$sec = (int)floor($this->curTimeout);
|
||||
$usec = (int)(1000000 * ($this->curTimeout - $sec));
|
||||
|
||||
// on windows this returns a "Warning: Invalid CRT parameters detected" error
|
||||
if (!@stream_select($read, $write, $except, $sec, $usec) && !count($read)) {
|
||||
|
Loading…
Reference in New Issue
Block a user