diff options
author | jsorg71 <jsorg71> | 2008-04-05 08:25:49 +0000 |
---|---|---|
committer | jsorg71 <jsorg71> | 2008-04-05 08:25:49 +0000 |
commit | 4ebb544cd889b9bf8ecfbc30969a86a48680085b (patch) | |
tree | f845441743659eef932e83c3e3e8272c874383a0 /xrdp/xrdp_mm.c | |
parent | 85e42c068c2a8c3e7b07e31b38bfd5d8f863c5bb (diff) | |
download | xrdp-proprietary-4ebb544cd889b9bf8ecfbc30969a86a48680085b.tar.gz xrdp-proprietary-4ebb544cd889b9bf8ecfbc30969a86a48680085b.zip |
main loop changes, not so chatty
Diffstat (limited to 'xrdp/xrdp_mm.c')
-rw-r--r-- | xrdp/xrdp_mm.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c index 7f3b8a2c..9c123d0a 100644 --- a/xrdp/xrdp_mm.c +++ b/xrdp/xrdp_mm.c @@ -89,6 +89,11 @@ xrdp_mm_delete(struct xrdp_mm* self) } /* free any module stuff */ xrdp_mm_module_cleanup(self); + if (self->sck_obj != 0) + { + g_delete_wait_obj_from_socket(self->sck_obj); + self->sck_obj = 0; + } if (self->sck != 0) { g_tcp_close(self->sck); @@ -396,16 +401,16 @@ xrdp_mm_setup_mod2(struct xrdp_mm* self) rv = 1; text[0] = 0; - if (!(self->wm->pro_layer->term)) + if (!g_is_wait_obj_set(self->wm->pro_layer->self_term_event)) { if (self->mod->mod_start(self->mod, self->wm->screen->width, self->wm->screen->height, self->wm->screen->bpp) != 0) { - self->wm->pro_layer->term = 1; /* kill session */ + g_set_wait_obj(self->wm->pro_layer->self_term_event); /* kill session */ } } - if (!(self->wm->pro_layer->term)) + if (!g_is_wait_obj_set(self->wm->pro_layer->self_term_event)) { if (self->display > 0) { @@ -419,11 +424,11 @@ xrdp_mm_setup_mod2(struct xrdp_mm* self) } else { - self->wm->pro_layer->term = 1; /* kill session */ + g_set_wait_obj(self->wm->pro_layer->self_term_event); /* kill session */ } } } - if (!(self->wm->pro_layer->term)) + if (!g_is_wait_obj_set(self->wm->pro_layer->self_term_event)) { /* this adds the port to the end of the list, it will already be in the list as -1 @@ -500,8 +505,7 @@ xrdp_mm_process_login_response(struct xrdp_mm* self, struct stream* s) { if (xrdp_mm_setup_mod2(self) == 0) { - self->wm->login_mode = 10; - self->wm->pro_layer->app_sck = self->mod->sck; + xrdp_wm_set_login_mode(self->wm, 10); self->wm->dragging = 0; } } @@ -511,13 +515,14 @@ xrdp_mm_process_login_response(struct xrdp_mm* self, struct stream* s) xrdp_wm_log_msg(self->wm, "login failed"); } /* close socket */ + g_delete_wait_obj_from_socket(self->sck_obj); + self->sck_obj = 0; g_tcp_close(self->sck); self->sck = 0; self->connected_state = 0; if (self->wm->login_mode != 10) { - self->wm->pro_layer->app_sck = 0; - self->wm->login_mode = 11; + xrdp_wm_set_login_mode(self->wm, 11); xrdp_mm_module_cleanup(self); } return rv; @@ -567,6 +572,7 @@ xrdp_mm_connect(struct xrdp_mm* self) ok = 0; errstr[0] = 0; self->sck = g_tcp_socket(); + self->sck_obj = g_create_wait_obj_from_socket(self->sck, 0); g_tcp_set_non_blocking(self->sck); g_snprintf(text, 255, "connecting to sesman ip %s port 3350", ip); xrdp_wm_log_msg(self->wm, text); @@ -604,12 +610,13 @@ xrdp_mm_connect(struct xrdp_mm* self) /* fully connect */ xrdp_wm_log_msg(self->wm, "sesman connect ok"); self->connected_state = 1; - self->wm->pro_layer->app_sck = self->sck; rv = xrdp_mm_send_login(self); } else { xrdp_wm_log_msg(self->wm, errstr); + g_delete_wait_obj_from_socket(self->sck_obj); + self->sck_obj = 0; g_tcp_close(self->sck); self->sck = 0; rv = 1; @@ -621,14 +628,12 @@ xrdp_mm_connect(struct xrdp_mm* self) { if (xrdp_mm_setup_mod2(self) == 0) { - self->wm->login_mode = 10; - self->wm->pro_layer->app_sck = self->mod->sck; + xrdp_wm_set_login_mode(self->wm, 10); } } if (self->wm->login_mode != 10) { - self->wm->pro_layer->app_sck = 0; - self->wm->login_mode = 11; + xrdp_wm_set_login_mode(self->wm, 11); xrdp_mm_module_cleanup(self); } } |