summaryrefslogtreecommitdiffstats
path: root/sesman/sesman.c
diff options
context:
space:
mode:
authorilsimo <ilsimo>2006-01-13 15:51:23 +0000
committerilsimo <ilsimo>2006-01-13 15:51:23 +0000
commit153b59ad8447d47d4a241e0f63307b096585172b (patch)
treed2aea8fe354a291308d80a2124dbfc05ec3fdaa8 /sesman/sesman.c
parentfade58ba2bf869e7e872d3003ac0962cb8f1233c (diff)
downloadxrdp-proprietary-153b59ad8447d47d4a241e0f63307b096585172b.tar.gz
xrdp-proprietary-153b59ad8447d47d4a241e0f63307b096585172b.zip
new session list code
added support for new [sessions] configuration options
Diffstat (limited to 'sesman/sesman.c')
-rw-r--r--sesman/sesman.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/sesman/sesman.c b/sesman/sesman.c
index 30cbd44f..5fbbdb6f 100644
--- a/sesman/sesman.c
+++ b/sesman/sesman.c
@@ -32,14 +32,25 @@
int g_sck;
int g_pid;
unsigned char g_fixedkey[8] = { 23, 82, 107, 6, 35, 78, 88, 7 };
+#ifdef OLDSESSION
struct session_item g_session_items[100]; /* sesman.h */
+extern int g_session_count;
+#endif
struct config_sesman g_cfg; /* config.h */
-/******************************************************************************/
+/**
+ *
+ * trigger when a child process (a session) dies
+ *
+ * @param s received signal
+ *
+ */
static void DEFAULT_CC
cterm(int s)
{
+#ifdef OLDSESSION
int i;
+#endif
int pid;
if (g_getpid() != g_pid)
@@ -49,13 +60,18 @@ cterm(int s)
pid = g_waitchild();
if (pid > 0)
{
+#ifdef OLDSESSION
for (i = 0; i < 100; i++)
{
if (g_session_items[i].pid == pid)
{
g_memset(g_session_items + i, 0, sizeof(struct session_item));
+ g_session_count--;
}
}
+#else
+ session_kill(pid);
+#endif
}
}
@@ -133,7 +149,8 @@ sesman_main_loop()
display = 0;
if (data)
{
- s_item = session_find_item(user, width, height, bpp);
+ //s_item = session_find_item(user, width, height, bpp);
+ s_item = session_get_bydata(user, width, height, bpp);
if (s_item != 0)
{
display = s_item->display;
@@ -325,7 +342,9 @@ main(int argc, char** argv)
}
/* signal handling */
+#ifdef OLDSESSION
g_memset(&g_session_items, 0, sizeof(g_session_items));
+#endif
g_pid = g_getpid();
g_signal(1, sig_sesman_reload_cfg); /* SIGHUP */
g_signal(2, sig_sesman_shutdown); /* SIGINT */