mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-02-04 21:08:28 +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
de09e8e817
commit
38a2a84da1
@ -3442,7 +3442,7 @@ class Net_SSH2
|
|||||||
*/
|
*/
|
||||||
function isConnected()
|
function isConnected()
|
||||||
{
|
{
|
||||||
return (bool) ($this->bitmap & NET_SSH2_MASK_CONNECTED);
|
return ($this->bitmap & NET_SSH2_MASK_CONNECTED) && is_resource($this->fsock) && !feof($this->fsock);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user