From 689f1b0a6b8a40bf15917abed450b568c031285b Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Wed, 25 Sep 2019 15:58:45 +0200 Subject: callbacks: Improve documentation about callbacks handling Fixes T103 Signed-off-by: Jakub Jelen Reviewed-by: Anderson Toshiyuki Sasaki --- include/libssh/callbacks.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/libssh/callbacks.h b/include/libssh/callbacks.h index 15e88014..972314cb 100644 --- a/include/libssh/callbacks.h +++ b/include/libssh/callbacks.h @@ -354,6 +354,9 @@ typedef struct ssh_server_callbacks_struct *ssh_server_callbacks; * This functions sets the callback structure to use your own callback * functions for user authentication, new channels and requests. * + * Note, that the structure is not copied to the session structure so it needs + * to be valid for the whole session lifetime. + * * @code * struct ssh_server_callbacks_struct cb = { * .userdata = data, @@ -548,6 +551,9 @@ typedef struct ssh_packet_callbacks_struct *ssh_packet_callbacks; * This functions sets the callback structure to use your own callback * functions for auth, logging and status. * + * Note, that the callback structure is not copied into the session so it needs + * to be valid for the whole session lifetime. + * * @code * struct ssh_callbacks_struct cb = { * .userdata = data, @@ -849,7 +855,11 @@ typedef struct ssh_channel_callbacks_struct *ssh_channel_callbacks; * @brief Set the channel callback functions. * * This functions sets the callback structure to use your own callback - * functions for channel data and exceptions + * functions for channel data and exceptions. + * + * Note, that the structure is not copied to the channel structure so it needs + * to be valid as for the whole life of the channel or until it is removed with + * ssh_remove_channel_callbacks(). * * @code * struct ssh_channel_callbacks_struct cb = { -- cgit v1.2.3