diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2008-06-16 23:02:49 +0000 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2008-06-16 23:02:49 +0000 |
commit | 77603dbc5a5c55ecfa8d583c133db844673fb690 (patch) | |
tree | 96c4ad653c74e1d53791f4a73c49d43cdcb58359 /libssh/session.c | |
parent | 5367581ce1d52518343bb8ede60738f4035e033a (diff) | |
download | libssh-77603dbc5a5c55ecfa8d583c133db844673fb690.tar.gz libssh-77603dbc5a5c55ecfa8d583c133db844673fb690.tar.xz libssh-77603dbc5a5c55ecfa8d583c133db844673fb690.zip |
Big changes :
refactoring of the socket class. Now the buffering happens in the socket class.
enhanced the logging system. Cleaned up some debugging messages.
Verified the working with ssh-1.
If this cleanup introduced bugs (it did but corrected the found ones) at least, they will be easier to find
also added the (c) and fixed dates for updated files
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@169 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/session.c')
-rw-r--r-- | libssh/session.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/libssh/session.c b/libssh/session.c index f8344fa8..80b9e3a1 100644 --- a/libssh/session.c +++ b/libssh/session.c @@ -1,7 +1,7 @@ /* session.c */ /* contains the non-networking functions ssh_* */ /* - * Copyright 2005-2008 Aris Adamantiadis + * Copyright (c) 2005-2008 Aris Adamantiadis * * This file is part of the SSH Library * @@ -41,10 +41,12 @@ SSH_SESSION *ssh_new() { memset(session,0,sizeof(SSH_SESSION)); session->next_crypto=crypto_new(); session->maxchannel=FIRST_CHANNEL; - session->socket=ssh_socket_new(); + session->socket=ssh_socket_new(session); session->alive=0; session->blocking=1; session->log_indent=0; + session->out_buffer=buffer_new(); + session->in_buffer=buffer_new(); return session; } @@ -59,10 +61,6 @@ void ssh_cleanup(SSH_SESSION *session){ buffer_free(session->in_buffer); if(session->out_buffer) buffer_free(session->out_buffer); - if(session->in_socket_buffer) - buffer_free(session->in_socket_buffer); - if(session->out_socket_buffer) - buffer_free(session->out_socket_buffer); if(session->banner) free(session->banner); if(session->options) @@ -105,7 +103,6 @@ void ssh_cleanup(SSH_SESSION *session){ */ void ssh_silent_disconnect(SSH_SESSION *session){ enter_function(); - ssh_log(session,SSH_LOG_ENTRY,"ssh_silent_disconnect()"); ssh_socket_close(session->socket); session->alive=0; ssh_disconnect(session); |