mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-26 11:37:33 +00:00
Merge branch '1.0' into 2.0
This commit is contained in:
commit
2cf180fb47
@ -410,6 +410,7 @@ class SFTP extends SSH2
|
||||
function login($username)
|
||||
{
|
||||
$args = func_get_args();
|
||||
$this->auth[] = $args;
|
||||
if (!call_user_func_array(array(&$this, '_login'), $args)) {
|
||||
return false;
|
||||
}
|
||||
@ -2975,6 +2976,20 @@ class SFTP extends SSH2
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets a connection for re-use
|
||||
*
|
||||
* @param int $reason
|
||||
* @access private
|
||||
*/
|
||||
function _reset_connection($reason)
|
||||
{
|
||||
parent::_reset_connection($reason);
|
||||
$this->use_request_id = false;
|
||||
$this->pwd = false;
|
||||
$this->requestBuffer = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Receives SFTP Packets
|
||||
*
|
||||
|
@ -3206,6 +3206,9 @@ class SSH2
|
||||
function ping()
|
||||
{
|
||||
if (!$this->isAuthenticated()) {
|
||||
if (!empty($this->auth)) {
|
||||
return $this->_reconnect();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -4113,11 +4116,13 @@ class SSH2
|
||||
if ($this->bitmap & self::MASK_CONNECTED) {
|
||||
$data = pack('CNNa*Na*', NET_SSH2_MSG_DISCONNECT, $reason, 0, '', 0, '');
|
||||
$this->_send_binary_packet($data);
|
||||
}
|
||||
|
||||
$this->bitmap = 0;
|
||||
fclose($this->fsock);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* String Shift
|
||||
|
Loading…
Reference in New Issue
Block a user