From 31ad9aacbd18f2153b78bd4536b9a8563505d051 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sun, 9 Sep 2012 23:45:18 -0500 Subject: [PATCH] stream_set_blocking calls were unnecessary --- phpseclib/Net/SSH2.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 97a5a214..3b1b4c2a 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -800,8 +800,6 @@ class Net_SSH2 { $read = array($this->fsock); $write = $except = NULL; - stream_set_blocking($this->fsock, false); - $sec = floor($timeout); $usec = 1000000 * ($timeout - $sec); @@ -812,8 +810,6 @@ class Net_SSH2 { return; } - stream_set_blocking($this->fsock, true); - /* According to the SSH2 specs, "The server MAY send other lines of data before sending the version @@ -2185,21 +2181,16 @@ class Net_SSH2 { $read = array($this->fsock); $write = $except = NULL; - stream_set_blocking($this->fsock, false); - $start = strtok(microtime(), ' ') + strtok(''); // http://php.net/microtime#61838 $sec = floor($this->curTimeout); $usec = 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)) { - stream_set_blocking($this->fsock, true); $this->_close_channel($client_channel); return true; } $elapsed = strtok(microtime(), ' ') + strtok('') - $start; $this->curTimeout-= $elapsed; - - stream_set_blocking($this->fsock, true); } $response = $this->_get_binary_packet();