mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-06-09 03:42:34 +00:00
Add EOF test to SSH2::isConnected
This adds an additional test to SSH2::isConnected to make it more intuitive. Aside from testing against the internal state, it will also assert that there is an internal socket and that that socket has not reached EOF.
This commit is contained in:
parent
5a02ce27ac
commit
3b03bad409
|
@ -2969,7 +2969,7 @@ class SSH2
|
|||
*/
|
||||
public function isConnected(): bool
|
||||
{
|
||||
return (bool) ($this->bitmap & self::MASK_CONNECTED);
|
||||
return (bool) ($this->bitmap & self::MASK_CONNECTED) && is_resource($this->fsock) && !feof($this->fsock);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user