diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2013-07-14 13:31:24 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2013-07-14 13:31:24 +0200 |
commit | c64ec43eef8ec5a8b8a8f4c4c3216043aea8e08a (patch) | |
tree | 33131e402f35d800cf923f837ae4c72166703b27 /src/session.c | |
parent | 0d3deeec101b0d6568d7c04eda833bde47c7329c (diff) | |
download | libssh-c64ec43eef8ec5a8b8a8f4c4c3216043aea8e08a.tar.gz libssh-c64ec43eef8ec5a8b8a8f4c4c3216043aea8e08a.tar.xz libssh-c64ec43eef8ec5a8b8a8f4c4c3216043aea8e08a.zip |
src: Remove enter_function() and leave_function().
Diffstat (limited to 'src/session.c')
-rw-r--r-- | src/session.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/src/session.c b/src/session.c index 61e14320..db7e0f99 100644 --- a/src/session.c +++ b/src/session.c @@ -89,7 +89,6 @@ ssh_session ssh_new(void) { session->alive = 0; session->auth_methods = 0; ssh_set_blocking(session, 1); - session->common.log_indent = 0; session->maxchannel = FIRST_CHANNEL; #ifndef _WIN32 @@ -286,8 +285,6 @@ const char* ssh_get_serverbanner(ssh_session session) { * @param[in] session The SSH session to disconnect. */ void ssh_silent_disconnect(ssh_session session) { - enter_function(); - if (session == NULL) { return; } @@ -295,7 +292,6 @@ void ssh_silent_disconnect(ssh_session session) { ssh_socket_close(session->socket); session->alive = 0; ssh_disconnect(session); - leave_function(); } /** @@ -347,20 +343,21 @@ static int ssh_flush_termination(void *c){ */ int ssh_blocking_flush(ssh_session session, int timeout){ - int rc; - if(!session) - return SSH_ERROR; - enter_function(); - - rc = ssh_handle_packets_termination(session, timeout, - ssh_flush_termination, session); - if (rc == SSH_ERROR) - goto end; - if (!ssh_flush_termination(session)) - rc = SSH_AGAIN; -end: - leave_function(); - return rc; + int rc; + if (session == NULL) { + return SSH_ERROR; + } + + rc = ssh_handle_packets_termination(session, timeout, + ssh_flush_termination, session); + if (rc == SSH_ERROR) { + return rc; + } + if (!ssh_flush_termination(session)) { + rc = SSH_AGAIN; + } + + return rc; } /** @@ -464,7 +461,6 @@ int ssh_handle_packets(ssh_session session, int timeout) { if (session == NULL || session->socket == NULL) { return SSH_ERROR; } - enter_function(); spoll_in = ssh_socket_get_poll_handle_in(session->socket); spoll_out = ssh_socket_get_poll_handle_out(session->socket); @@ -493,7 +489,6 @@ int ssh_handle_packets(ssh_session session, int timeout) { session->session_state = SSH_SESSION_STATE_ERROR; } - leave_function(); return rc; } @@ -640,12 +635,11 @@ int ssh_get_version(ssh_session session) { */ void ssh_socket_exception_callback(int code, int errno_code, void *user){ ssh_session session=(ssh_session)user; - enter_function(); + SSH_LOG(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(); } /** |