1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-23 01:22:37 +03:00

libssh2_session_handshake: replaces libssh2_session_startup()

The function libssh2_session_startup() is now considered deprecated due
to the portability issue with the socket argument.
libssh2_session_handshake() is the name of the replacement.
This commit is contained in:
Daniel Stenberg
2010-10-07 19:51:28 +02:00
parent c34e1d8735
commit 0d58af6aec
5 changed files with 69 additions and 6 deletions

View File

@@ -725,16 +725,15 @@ session_startup(LIBSSH2_SESSION *session, libssh2_socket_t sock)
}
/*
* proto libssh2_session_startup
* libssh2_session_handshake()
*
* session: LIBSSH2_SESSION struct allocated and owned by the calling program
* sock: *must* be populated with an opened and connected socket.
*
* Returns: 0 on success, or non-zero on failure
* Any memory allocated by libssh2 will use alloc/realloc/free
* callbacks in session.
* The 'sock' socket *must* be populated with an opened and connected socket.
*/
LIBSSH2_API int
libssh2_session_startup(LIBSSH2_SESSION *session, int sock)
libssh2_session_handshake(LIBSSH2_SESSION *session, libssh2_socket_t sock)
{
int rc;
@@ -743,6 +742,23 @@ libssh2_session_startup(LIBSSH2_SESSION *session, int sock)
return rc;
}
/*
* libssh2_session_startup()
*
* DEPRECATED. Use libssh2_session_handshake() instead! This function is not
* portable enough.
*
* session: LIBSSH2_SESSION struct allocated and owned by the calling program
* sock: *must* be populated with an opened and connected socket.
*
* Returns: 0 on success, or non-zero on failure
*/
LIBSSH2_API int
libssh2_session_startup(LIBSSH2_SESSION *session, int sock)
{
return libssh2_session_handshake(session, (libssh2_socket_t) sock);
}
/*
* libssh2_session_free
*