summaryrefslogtreecommitdiffstats
path: root/xrdp/xrdp_listen.c
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2005-01-30 04:34:19 +0000
committerjsorg71 <jsorg71>2005-01-30 04:34:19 +0000
commit0aff0efb522745ba9f9d64a505c22ef23a386cff (patch)
treec1dfef437314cf8388acf906d4c55992de393a80 /xrdp/xrdp_listen.c
parentf0c7bdb304846829259edaab25454f81ab5a4c36 (diff)
downloadxrdp-proprietary-0aff0efb522745ba9f9d64a505c22ef23a386cff.tar.gz
xrdp-proprietary-0aff0efb522745ba9f9d64a505c22ef23a386cff.zip
added session manager and fixed disconnect problems
Diffstat (limited to 'xrdp/xrdp_listen.c')
-rw-r--r--xrdp/xrdp_listen.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/xrdp/xrdp_listen.c b/xrdp/xrdp_listen.c
index 492466ee..f46cb187 100644
--- a/xrdp/xrdp_listen.c
+++ b/xrdp/xrdp_listen.c
@@ -47,17 +47,31 @@ int xrdp_listen_term_processes(struct xrdp_listen* self)
/* tell all xrdp processes to end */
for (i = 0; i < self->process_list_count; i++)
+ {
if (self->process_list[i] != 0)
+ {
self->process_list[i]->term = 1;
+ }
+ }
/* make sure they are done */
for (i = 0; i < self->process_list_count; i++)
+ {
if (self->process_list[i] != 0)
+ {
while (self->process_list[i]->status > 0)
+ {
g_sleep(10);
+ }
+ }
+ }
/* free them all */
for (i = 0; i < self->process_list_count; i++)
+ {
if (self->process_list[i] != 0)
+ {
xrdp_process_delete(self->process_list[i]);
+ }
+ }
return 0;
}
@@ -133,9 +147,13 @@ int xrdp_listen_main_loop(struct xrdp_listen* self)
{
error = g_tcp_accept(self->sck);
if (error == -1 && g_tcp_last_error_would_block(self->sck))
+ {
g_sleep(100);
+ }
else if (error == -1)
+ {
break;
+ }
else
{
g_process = xrdp_process_create(self);
@@ -147,7 +165,9 @@ int xrdp_listen_main_loop(struct xrdp_listen* self)
g_sleep(100);
}
else
+ {
xrdp_process_delete(g_process);
+ }
}
}
}