summaryrefslogtreecommitdiffstats
path: root/xrdp/xrdp_mm.c
diff options
context:
space:
mode:
Diffstat (limited to 'xrdp/xrdp_mm.c')
-rw-r--r--xrdp/xrdp_mm.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c
index 223b128b..4060fd86 100644
--- a/xrdp/xrdp_mm.c
+++ b/xrdp/xrdp_mm.c
@@ -62,6 +62,7 @@ xrdp_mm_sync_load(long param1, long param2)
static void APP_CC
xrdp_mm_module_cleanup(struct xrdp_mm* self)
{
+ g_writeln("xrdp_mm_module_cleanup");
if (self->mod != 0)
{
if (self->mod_exit != 0)
@@ -72,7 +73,7 @@ xrdp_mm_module_cleanup(struct xrdp_mm* self)
}
if (self->mod_handle != 0)
{
- /* main thread unload */
+ /* Let the main thread unload the module.*/
g_xrdp_sync(xrdp_mm_sync_unload, self->mod_handle, 0);
}
trans_delete(self->chan_trans);
@@ -280,6 +281,7 @@ xrdp_mm_setup_mod1(struct xrdp_mm* self)
}
if (self->mod_handle == 0)
{
+ /* Let the main thread load the lib,*/
self->mod_handle = g_xrdp_sync(xrdp_mm_sync_load, (long)lib, 0);
if (self->mod_handle != 0)
{
@@ -315,6 +317,8 @@ xrdp_mm_setup_mod1(struct xrdp_mm* self)
g_writeln("loaded module '%s' ok, interface size %d, version %d", lib,
self->mod->size, self->mod->version);
}
+ }else{
+ g_writeln("no mod_init or mod_exit address found");
}
}
else
@@ -322,6 +326,7 @@ xrdp_mm_setup_mod1(struct xrdp_mm* self)
g_snprintf(text, 255, "error loading %s specified in xrdp.ini, please "
"add a valid entry like lib=libxrdp-vnc.so or similar", lib);
xrdp_wm_log_msg(self->wm, text);
+ return 1 ;
}
if (self->mod != 0)
{
@@ -698,7 +703,7 @@ xrdp_mm_connect_chansrv(struct xrdp_mm* self, char* ip, char* port)
self->usechansrv = 1;
/* connect channel redir */
- if ((ip == 0) || (strcmp(ip, "127.0.0.1") == 0) || (ip[0] == 0))
+ if ((ip == 0) || (g_strcmp(ip, "127.0.0.1") == 0) || (ip[0] == 0))
{
/* unix socket */
self->chan_trans = trans_create(TRANS_MODE_UNIX, 8192, 8192);
@@ -750,8 +755,6 @@ xrdp_mm_process_login_response(struct xrdp_mm* self, struct stream* s)
int ok;
int display;
int rv;
- int uid;
- int gid;
char text[256];
char ip[256];
char port[256];
@@ -773,7 +776,7 @@ xrdp_mm_process_login_response(struct xrdp_mm* self, struct stream* s)
xrdp_wm_set_login_mode(self->wm, 10);
self->wm->dragging = 0;
/* connect channel redir */
- if ((ip == 0) || (strcmp(ip, "127.0.0.1") == 0) || (ip[0] == 0))
+ if ((ip == 0) || (g_strcmp(ip, "127.0.0.1") == 0) || (ip[0] == 0))
{
g_snprintf(port, 255, "/tmp/.xrdp/xrdp_chansrv_socket_%d", 7200 + display);
}
@@ -1041,20 +1044,25 @@ xrdp_mm_connect(struct xrdp_mm* self)
if (xrdp_mm_setup_mod2(self) == 0)
{
xrdp_wm_set_login_mode(self->wm, 10);
+ rv = 0 ; /*sucess*/
}
else
{
/* connect error */
g_snprintf(errstr, 255, "Failure to connect to: %s port: %s",
ip, port);
+ g_writeln(errstr);
xrdp_wm_log_msg(self->wm, errstr);
- rv = 1 ; /* failure */
+ rv = 1; /* failure */
}
+ }else{
+ g_writeln("Failure setting up module");
}
if (self->wm->login_mode != 10)
{
xrdp_wm_set_login_mode(self->wm, 11);
xrdp_mm_module_cleanup(self);
+ rv = 1 ; /* failure */
}
}
self->sesman_controlled = use_sesman;
@@ -1065,6 +1073,7 @@ xrdp_mm_connect(struct xrdp_mm* self)
/* if sesman controlled, this will connect later */
xrdp_mm_connect_chansrv(self, "", chansrvport);
}
+ g_writeln("returnvalue from xrdp_mm_connect %d",rv);
return rv;
}
@@ -1084,11 +1093,11 @@ xrdp_mm_get_wait_objs(struct xrdp_mm* self,
rv = 0;
if ((self->sesman_trans != 0) && self->sesman_trans_up)
{
- trans_get_wait_objs(self->sesman_trans, read_objs, rcount, timeout);
+ trans_get_wait_objs(self->sesman_trans, read_objs, rcount);
}
if ((self->chan_trans != 0) && self->chan_trans_up)
{
- trans_get_wait_objs(self->chan_trans, read_objs, rcount, timeout);
+ trans_get_wait_objs(self->chan_trans, read_objs, rcount);
}
if (self->mod != 0)
{