mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
Improve ssh_get_version().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@477 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
@@ -319,12 +319,19 @@ const char *ssh_get_disconnect_message(SSH_SESSION *session) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \brief get the protocol version of the session
|
/**
|
||||||
* \param session ssh session
|
* @brief Get the protocol version of the session.
|
||||||
* \return 1 or 2, for ssh1 or ssh2
|
*
|
||||||
|
* @param session The ssh session to use.
|
||||||
|
*
|
||||||
|
* @return 1 or 2, for ssh1 or ssh2, < 0 on error.
|
||||||
*/
|
*/
|
||||||
int ssh_get_version(SSH_SESSION *session){
|
int ssh_get_version(SSH_SESSION *session) {
|
||||||
return session->version;
|
if (session == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return session->version;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|||||||
Reference in New Issue
Block a user