diff options
author | milo <milo@r0ot.me> | 2010-08-12 23:25:20 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cynapses.org> | 2010-08-13 11:17:09 +0200 |
commit | e533c3f33b83a7a7fd820bf1fee91c53b11228c1 (patch) | |
tree | 64a339474bcf96f2c653c329b4783d2ba1fc0487 /libssh/session.c | |
parent | 41ab19e1d05ff598cf3f2fc3aca8631e4403dd93 (diff) | |
download | libssh-e533c3f33b83a7a7fd820bf1fee91c53b11228c1.tar.gz libssh-e533c3f33b83a7a7fd820bf1fee91c53b11228c1.tar.xz libssh-e533c3f33b83a7a7fd820bf1fee91c53b11228c1.zip |
server: Fix missing socket close notification.
Signed-off-by: Andreas Schneider <asn@cynapses.org>
Diffstat (limited to 'libssh/session.c')
-rw-r--r-- | libssh/session.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/libssh/session.c b/libssh/session.c index 06e0a259..a70826f6 100644 --- a/libssh/session.c +++ b/libssh/session.c @@ -500,6 +500,21 @@ SSH_PACKET_CALLBACK(ssh_packet_ignore_callback){ return SSH_PACKET_USED; } +/** + * @internal + * @brief Callback to be called when the socket received an exception code. + * @param user is a pointer to session + */ +void ssh_socket_exception_callback(int code, int errno_code, void *user){ + ssh_session session=(ssh_session)user; + enter_function(); + ssh_log(session,SSH_LOG_RARE,"Socket exception callback: %d (%d)",code, errno_code); + session->session_state=SSH_SESSION_STATE_ERROR; + ssh_set_error(session,SSH_FATAL,"Socket error: %s",strerror(errno_code)); + session->ssh_connection_callback(session); + leave_function(); +} + /* @} */ -/* vim: set ts=2 sw=2 et cindent: */ +/* vim: set ts=4 sw=4 et cindent: */ |