From a9c0e2d4300533de468503587ad4021d42393ccd Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sun, 16 Dec 2018 11:44:58 -0600 Subject: [PATCH] SSH2: setTimeout(0) didn't work as intended --- phpseclib/Net/SSH2.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 7c0b0355..6c08156f 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -3785,7 +3785,12 @@ class Net_SSH2 $response = $this->binary_packet_buffer; $this->binary_packet_buffer = false; } else { - if ($this->curTimeout) { + $read = array($this->fsock); + $write = $except = null; + + if (!$this->curTimeout) { + @stream_select($read, $write, $except, null); + } else { if ($this->curTimeout < 0) { $this->is_timeout = true; return true;