SSH2: don't set stream timeout if timeout is 0

This commit is contained in:
terrafrost 2024-02-28 22:40:13 -06:00
parent 792314e851
commit c20dd784f0
1 changed files with 5 additions and 3 deletions

View File

@ -3561,9 +3561,11 @@ class SSH2
}
$start = microtime(true);
$sec = (int) floor($this->curTimeout);
$usec = (int) (1000000 * ($this->curTimeout - $sec));
stream_set_timeout($this->fsock, $sec, $usec);
if ($this->curTimeout) {
$sec = (int) floor($this->curTimeout);
$usec = (int) (1000000 * ($this->curTimeout - $sec));
stream_set_timeout($this->fsock, $sec, $usec);
}
$raw = stream_get_contents($this->fsock, $this->decrypt_block_size);
if (!strlen($raw)) {