Skip to content

Commit

Permalink
SSH2: don't set stream timeout if timeout is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
terrafrost committed Feb 29, 2024
1 parent 792314e commit c20dd78
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions phpseclib/Net/SSH2.php
Expand Up @@ -3561,9 +3561,11 @@ private function get_binary_packet($skip_channel_filter = false)
}

$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)) {
Expand Down

1 comment on commit c20dd78

@terrafrost
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1986

Please sign in to comment.