mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-23 01:22:37 +03:00
new function: libssh2_session_banner_get
Returns the banner from the server handshake Fixes #226
This commit is contained in:
@@ -1718,3 +1718,19 @@ libssh2_session_block_directions(LIBSSH2_SESSION *session)
|
||||
return session->socket_block_directions;
|
||||
}
|
||||
|
||||
/* libssh2_session_banner_get
|
||||
* Get the remote banner (server ID string)
|
||||
*/
|
||||
|
||||
LIBSSH2_API const char *
|
||||
libssh2_session_banner_get(LIBSSH2_SESSION *session)
|
||||
{
|
||||
/* to avoid a coredump when session is NULL */
|
||||
if (NULL == session)
|
||||
return NULL;
|
||||
|
||||
if (NULL==session->remote.banner)
|
||||
return NULL;
|
||||
|
||||
return (const char *) session->remote.banner;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user