aboutsummaryrefslogtreecommitdiff
path: root/libssh/session.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2006-11-12 00:57:48 +0000
committerAris Adamantiadis <aris@0xbadc0de.be>2006-11-12 00:57:48 +0000
commitff273b26b366c1aa2502b3a9828b256cc8d04a06 (patch)
tree00176cf184e0ff22c427ae38768a35b694d918ef /libssh/session.c
parent4442e0e26206a1242a0a9268de5e2731c439e34e (diff)
downloadlibssh-ff273b26b366c1aa2502b3a9828b256cc8d04a06.tar.gz
libssh-ff273b26b366c1aa2502b3a9828b256cc8d04a06.tar.xz
libssh-ff273b26b366c1aa2502b3a9828b256cc8d04a06.zip
oops, forgot to verify that it compiled fine
also, published changes from Norbert including lots of session->fd checks git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@81 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/session.c')
-rw-r--r--libssh/session.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libssh/session.c b/libssh/session.c
index a73599e7..bb7858ef 100644
--- a/libssh/session.c
+++ b/libssh/session.c
@@ -43,6 +43,7 @@ SSH_SESSION *ssh_new() {
session->next_crypto=crypto_new();
session->maxchannel=FIRST_CHANNEL;
session->fd=-1;
+ session->alive=0;
session->blocking=1;
return session;
}
@@ -96,8 +97,10 @@ void ssh_cleanup(SSH_SESSION *session){
* \param session current ssh session
*/
void ssh_silent_disconnect(SSH_SESSION *session){
- close(session->fd);
+ if(session->fd>=0)
+ close(session->fd);
session->alive=0;
+ session->fd=-1;
ssh_disconnect(session);
}