summaryrefslogtreecommitdiffstats
path: root/xrdp
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2012-05-07 11:00:32 -0700
committerJay Sorg <jay.sorg@gmail.com>2012-05-07 11:00:32 -0700
commit3e422c04c6289f3f1f7cf9ce4325982b942ede7c (patch)
tree90d6d4e81caaf366d217e7adaf049623ef7e14c7 /xrdp
parent9a03ab966d4d5e7883ff201dc6d455e5e7b7fb5f (diff)
downloadxrdp-proprietary-3e422c04c6289f3f1f7cf9ce4325982b942ede7c.tar.gz
xrdp-proprietary-3e422c04c6289f3f1f7cf9ce4325982b942ede7c.zip
fixes from ArvidNorr
Diffstat (limited to 'xrdp')
-rw-r--r--xrdp/xrdp_mm.c26
-rw-r--r--xrdp/xrdp_wm.c14
2 files changed, 27 insertions, 13 deletions
diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c
index 055d0f91..c15c4bd5 100644
--- a/xrdp/xrdp_mm.c
+++ b/xrdp/xrdp_mm.c
@@ -375,9 +375,8 @@ xrdp_mm_setup_mod2(struct xrdp_mm* self)
int device_flags;
int use_uds;
- g_memset(text,0,sizeof(char) * 256);
- rv = 1;
- text[0] = 0;
+ rv = 1; /* failure */
+ g_memset(text, 0, sizeof(text));
if (!g_is_wait_obj_set(self->wm->pro_layer->self_term_event))
{
if (self->mod->mod_start(self->mod, self->wm->screen->width,
@@ -444,7 +443,7 @@ xrdp_mm_setup_mod2(struct xrdp_mm* self)
/* connect */
if (self->mod->mod_connect(self->mod) == 0)
{
- rv = 0;
+ rv = 0; /* connect success */
}
}
if (rv == 0)
@@ -953,11 +952,12 @@ xrdp_mm_connect(struct xrdp_mm* self)
char port[8];
char chansrvport[256];
- g_memset(ip,0,sizeof(char) * 256);
- g_memset(errstr,0,sizeof(char) * 256);
- g_memset(text,0,sizeof(char) * 256);
- g_memset(port,0,sizeof(char) * 8);
- rv = 0;
+ g_memset(ip, 0, sizeof(ip));
+ g_memset(errstr, 0, sizeof(errstr));
+ g_memset(text, 0, sizeof(text));
+ g_memset(port, 0, sizeof(port));
+ g_memset(chansrvport, 0, sizeof(chansrvport));
+ rv = 0; /* success */
use_sesman = 0;
names = self->login_names;
values = self->login_values;
@@ -1033,6 +1033,14 @@ xrdp_mm_connect(struct xrdp_mm* self)
{
xrdp_wm_set_login_mode(self->wm, 10);
}
+ else
+ {
+ /* connect error */
+ g_snprintf(errstr, 255, "Failure to connect to: %s port: %s",
+ ip, port);
+ xrdp_wm_log_msg(self->wm, errstr);
+ rv = 1 ; /* failure */
+ }
}
if (self->wm->login_mode != 10)
{
diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c
index 8029d517..7d15c3d0 100644
--- a/xrdp/xrdp_wm.c
+++ b/xrdp/xrdp_wm.c
@@ -1475,10 +1475,16 @@ xrdp_wm_login_mode_changed(struct xrdp_wm* self)
}
else if (self->login_mode == 2)
{
- xrdp_wm_set_login_mode(self, 3); /* put the wm in connected mode */
- xrdp_wm_delete_all_childs(self);
- self->dragging = 0;
- xrdp_mm_connect(self->mm);
+ if (xrdp_mm_connect(self->mm) == 0)
+ {
+ xrdp_wm_set_login_mode(self, 3); /* put the wm in connected mode */
+ xrdp_wm_delete_all_childs(self);
+ self->dragging = 0;
+ }
+ else
+ {
+ /* we do nothing on connect error so far */
+ }
}
else if (self->login_mode == 10)
{