ssh client now reuses an existing session instead of opening a new one
This commit is contained in:
parent
624a84cbfb
commit
ec650a65f7
32 changed files with 395 additions and 451 deletions
|
|
@ -23,6 +23,13 @@ namespace libssh {
|
|||
|
||||
ErrorCode Client::connectToHost(const ServerCredentials &credentials)
|
||||
{
|
||||
if (m_session != nullptr) {
|
||||
if (!ssh_is_connected(m_session)) {
|
||||
ssh_free(m_session);
|
||||
m_session = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_session == nullptr) {
|
||||
m_session = ssh_new();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue