1
1

libssh2_banner_set => libssh2_session_banner_get

Marked the old function as deprecated. Added the new name in the correct
name space with the same arguments and functionality.
Этот коммит содержится в:
Daniel Stenberg 2011-09-09 23:11:42 +02:00
родитель f2c21f6f84
Коммит 7229d989e7
6 изменённых файлов: 54 добавлений и 7 удалений

1
TODO
Просмотреть файл

@ -51,6 +51,7 @@ At next SONAME bump
libssh2_poll() libssh2_poll()
libssh2_poll_channel_read() libssh2_poll_channel_read()
libssh2_session_startup() (libssh2_session_handshake() is the replacement) libssh2_session_startup() (libssh2_session_handshake() is the replacement)
libssh2_banner_set() (libssh2_session_banner_set() is the repacement)
* Rename a few function: * Rename a few function:

Просмотреть файл

@ -93,6 +93,7 @@ dist_man_MANS = \
libssh2_scp_send_ex.3 \ libssh2_scp_send_ex.3 \
libssh2_session_abstract.3 \ libssh2_session_abstract.3 \
libssh2_session_banner_get.3 \ libssh2_session_banner_get.3 \
libssh2_session_banner_set.3 \
libssh2_session_block_directions.3 \ libssh2_session_block_directions.3 \
libssh2_session_callback_set.3 \ libssh2_session_callback_set.3 \
libssh2_session_disconnect.3 \ libssh2_session_disconnect.3 \

Просмотреть файл

@ -8,6 +8,9 @@ int
libssh2_banner_set(LIBSSH2_SESSION *session, const char *banner); libssh2_banner_set(LIBSSH2_SESSION *session, const char *banner);
.SH DESCRIPTION .SH DESCRIPTION
This function is \fbDEPRECATED\fP. Use \fIlibssh2_session_banner_set(3)\fP
instead!
\fIsession\fP - Session instance as returned by \fIsession\fP - Session instance as returned by
.BR libssh2_session_init_ex(3) .BR libssh2_session_init_ex(3)
@ -17,14 +20,13 @@ Set the banner that will be sent to the remote host when the SSH session is
started with started with
.BR libssh2_session_startup(3) .BR libssh2_session_startup(3)
This is optional; a banner corresponding to the protocol and libssh2 version will be sent by default. This is optional; a banner corresponding to the protocol and libssh2 version will be sent by default.
.SH RETURN VALUE .SH RETURN VALUE
Return 0 on success or negative on failure. It returns Return 0 on success or negative on failure. It returns
LIBSSH2_ERROR_EAGAIN when it would otherwise block. While LIBSSH2_ERROR_EAGAIN when it would otherwise block. While
LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se. LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se.
.SH AVAILABILITY
Marked as deprecated since 1.4.0
.SH ERRORS .SH ERRORS
\fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed. \fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed.
.SH SEE ALSO .SH SEE ALSO
.BR libssh2_session_startup(3) .BR libssh2_session_handshake(3)

Просмотреть файл

@ -13,6 +13,8 @@ the banner each server presents.
A pointer to a string or NULL if something failed. The data pointed to will be A pointer to a string or NULL if something failed. The data pointed to will be
allocated and associated to the session handle and will be freed by libssh2 allocated and associated to the session handle and will be freed by libssh2
when \fIlibssh2_session_free(3)\fP is used. when \fIlibssh2_session_free(3)\fP is used.
.SH AVAILABILITY
Added in 1.4.0
.SH SEE ALSO .SH SEE ALSO
.BR libssh2_session_banner_set(3), .BR libssh2_session_banner_set(3),
.BR libssh2_session_handshake(3), .BR libssh2_session_handshake(3),

32
docs/libssh2_session_banner_set.3 Обычный файл
Просмотреть файл

@ -0,0 +1,32 @@
.TH libssh2_session_banner_set 3 "9 Sep 2011" "libssh2 1.4.0" "libssh2 manual"
.SH NAME
libssh2_session_banner_set - set the SSH prococol banner for the local client
.SH SYNOPSIS
#include <libssh2.h>
int
libssh2_session_banner_set(LIBSSH2_SESSION *session, const char *banner);
.SH DESCRIPTION
\fIsession\fP - Session instance as returned by
.BR libssh2_session_init_ex(3)
\fIbanner\fP - A pointer to a zero-terminated string holding the user defined
banner
Set the banner that will be sent to the remote host when the SSH session is
started with \fIlibssh2_session_startup(3)\fP This is optional; a banner
corresponding to the protocol and libssh2 version will be sent by default.
.SH RETURN VALUE
Returns 0 on success or negative on failure. It returns LIBSSH2_ERROR_EAGAIN
when it would otherwise block. While LIBSSH2_ERROR_EAGAIN is a negative
number, it isn't really a failure per se.
.SH ERRORS
\fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed.
.SH AVAILABILITY
Added in 1.4.0.
Before 1.4.0 this function was known as libssh2_banner_set(3)
.SH SEE ALSO
.BR libssh2_session_handshake(3),
.BR libssh2_session_banner_get(3)

Просмотреть файл

@ -411,11 +411,11 @@ get_socket_nonblocking(int sockfd)
#endif #endif
} }
/* libssh2_banner_set /* libssh2_session_banner_set
* Set the local banner * Set the local banner to use in the server handshake.
*/ */
LIBSSH2_API int LIBSSH2_API int
libssh2_banner_set(LIBSSH2_SESSION * session, const char *banner) libssh2_session_banner_set(LIBSSH2_SESSION * session, const char *banner)
{ {
size_t banner_len = banner ? strlen(banner) : 0; size_t banner_len = banner ? strlen(banner) : 0;
@ -446,6 +446,15 @@ libssh2_banner_set(LIBSSH2_SESSION * session, const char *banner)
return 0; return 0;
} }
/* libssh2_banner_set
* Set the local banner. DEPRECATED VERSION
*/
LIBSSH2_API int
libssh2_banner_set(LIBSSH2_SESSION * session, const char *banner)
{
return libssh2_session_banner_set(session, banner);
}
/* /*
* libssh2_session_init_ex * libssh2_session_init_ex
* *