mirror of
https://github.com/danog/tgseclib.git
synced 2025-01-21 21:41:14 +01:00
Workaround for buggy stream_select's
Workaround for this issue: https://bugs.php.net/bug.php?id=42682 Thanks solefald!
This commit is contained in:
parent
e2ae5100c2
commit
5de5d45bd5
@ -801,7 +801,7 @@ class Net_SSH2 {
|
|||||||
stream_set_blocking($this->fsock, false);
|
stream_set_blocking($this->fsock, false);
|
||||||
|
|
||||||
// on windows this returns a "Warning: Invalid CRT parameters detected" error
|
// on windows this returns a "Warning: Invalid CRT parameters detected" error
|
||||||
if (!@stream_select($read, $write, $except, $timeout - $elapsed)) {
|
if (!@stream_select($read, $write, $except, $timeout - $elapsed) && !count($read)) {
|
||||||
user_error(rtrim("Cannot connect to $host. Banner timeout"), E_USER_NOTICE);
|
user_error(rtrim("Cannot connect to $host. Banner timeout"), E_USER_NOTICE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2183,7 +2183,7 @@ class Net_SSH2 {
|
|||||||
|
|
||||||
$start = strtok(microtime(), ' ') + strtok(''); // http://php.net/microtime#61838
|
$start = strtok(microtime(), ' ') + strtok(''); // http://php.net/microtime#61838
|
||||||
// on windows this returns a "Warning: Invalid CRT parameters detected" error
|
// on windows this returns a "Warning: Invalid CRT parameters detected" error
|
||||||
if (!@stream_select($read, $write, $except, $this->curTimeout)) {
|
if (!@stream_select($read, $write, $except, $this->curTimeout) && !count($read)) {
|
||||||
stream_set_blocking($this->fsock, true);
|
stream_set_blocking($this->fsock, true);
|
||||||
$this->_close_channel($client_channel);
|
$this->_close_channel($client_channel);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user