summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-09-29 10:57:35 +1100
committerDamien Miller <djm@mindrot.org>2000-09-29 10:57:35 +1100
commit15e7d4b64c237243657742cb50fead1062bbb92e (patch)
treef5b553bd3e53586b62e71f8e8d96919ab1ac1f5e /session.c
parentecf5830e8aff013f4274fafcfe77853749a69bf7 (diff)
- (djm) Fix SSH2 not terminating until all background tasks done problem.
Diffstat (limited to 'session.c')
-rw-r--r--session.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/session.c b/session.c
index 296dfade..ca12a4f7 100644
--- a/session.c
+++ b/session.c
@@ -150,6 +150,8 @@ char *original_command = NULL;
/* data */
#define MAX_SESSIONS 10
Session sessions[MAX_SESSIONS];
+static int num_used_sessions;
+
#ifdef WITH_AIXAUTHENTICATE
/* AIX's lastlogin message, set in auth1.c */
char *aixloginmsg;
@@ -1422,6 +1424,7 @@ session_new(void)
sessions[i].used = 0;
sessions[i].self = i;
}
+ num_used_sessions = 0;
did_init = 1;
}
for(i = 0; i < MAX_SESSIONS; i++) {
@@ -1440,7 +1443,8 @@ session_new(void)
s->auth_proto = NULL;
s->used = 1;
s->pw = NULL;
- debug("session_new: session %d", i);
+ num_used_sessions++;
+ debug("session_new: session %d (%d used)", i, num_used_sessions);
return s;
}
}
@@ -1853,6 +1857,7 @@ session_close(Session *s)
session_pty_cleanup(s);
session_free(s);
session_proctitle(s);
+ num_used_sessions--;
}
void
@@ -1898,6 +1903,11 @@ session_close_by_channel(int id, void *arg)
}
}
+int used_sessions(void)
+{
+ return(num_used_sessions);
+}
+
char *
session_tty_list(void)
{