diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2015-12-11 20:41:17 -0800 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2015-12-11 20:41:17 -0800 |
commit | 4e0d0f3ba06028c27f80b47dacbd8a7d323e7a93 (patch) | |
tree | 4fc02867a31074a1ab57ce8b8587af05a425b8e3 /sesman/sesman.c | |
parent | 4f128c530c6b7bfd014f23878f83bcd2369f793f (diff) | |
download | xrdp-proprietary-4e0d0f3ba06028c27f80b47dacbd8a7d323e7a93.tar.gz xrdp-proprietary-4e0d0f3ba06028c27f80b47dacbd8a7d323e7a93.zip |
sesman: remove the thread
Diffstat (limited to 'sesman/sesman.c')
-rw-r--r-- | sesman/sesman.c | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/sesman/sesman.c b/sesman/sesman.c index 9a3e915e..924a7ae8 100644 --- a/sesman/sesman.c +++ b/sesman/sesman.c @@ -1,7 +1,7 @@ /** * xrdp: A Remote Desktop Protocol server. * - * Copyright (C) Jay Sorg 2004-2013 + * Copyright (C) Jay Sorg 2004-2015 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,10 +31,7 @@ int g_pid; unsigned char g_fixedkey[8] = { 23, 82, 107, 6, 35, 78, 88, 7 }; struct config_sesman *g_cfg; /* defined in config.h */ -tbus g_term_event = 0; -tbus g_sync_event = 0; - -extern int g_thread_sck; /* in thread.c */ +tintptr g_term_event = 0; /******************************************************************************/ /** @@ -49,6 +46,7 @@ sesman_main_loop(void) int error; int robjs_count; int cont; + int pid; tbus sck_obj; tbus robjs[8]; @@ -80,7 +78,6 @@ sesman_main_loop(void) robjs_count = 0; robjs[robjs_count++] = sck_obj; robjs[robjs_count++] = g_term_event; - robjs[robjs_count++] = g_sync_event; /* wait */ if (g_obj_wait(robjs, robjs_count, 0, 0, -1) != 0) @@ -94,12 +91,6 @@ sesman_main_loop(void) break; } - if (g_is_wait_obj_set(g_sync_event)) /* sync */ - { - g_reset_wait_obj(g_sync_event); - session_sync_start(); - } - if (g_is_wait_obj_set(sck_obj)) /* incoming connection */ { in_sck = g_tcp_accept(g_sck); @@ -118,8 +109,8 @@ sesman_main_loop(void) { /* we've got a connection, so we pass it to scp code */ LOG_DBG("new connection"); - thread_scp_start(in_sck); - /* todo, do we have to wait here ? */ + scp_process_start((void*)(tintptr)in_sck); + g_sck_close(in_sck); } } } @@ -138,9 +129,7 @@ sesman_main_loop(void) "port '%s': %d (%s)", g_cfg->listen_port, g_get_errno(), g_get_strerror()); } - - if (g_sck != -1) - g_tcp_close(g_sck); + g_tcp_close(g_sck); } /******************************************************************************/ @@ -292,6 +281,9 @@ main(int argc, char **argv) g_writeln("error opening log file [%s]. quitting.", getLogFile(text, 255)); break; + default: + g_writeln("error"); + break; } g_deinit(); @@ -329,9 +321,6 @@ main(int argc, char **argv) } } - /* initializing locks */ - lock_init(); - /* signal handling */ g_pid = g_getpid(); /* old style signal handling is now managed synchronously by a @@ -387,8 +376,6 @@ main(int argc, char **argv) g_snprintf(text, 255, "xrdp_sesman_%8.8x_main_term", g_pid); g_term_event = g_create_wait_obj(text); - g_snprintf(text, 255, "xrdp_sesman_%8.8x_main_sync", g_pid); - g_sync_event = g_create_wait_obj(text); sesman_main_loop(); @@ -399,7 +386,6 @@ main(int argc, char **argv) } g_delete_wait_obj(g_term_event); - g_delete_wait_obj(g_sync_event); if (!daemon) { |