diff options
Diffstat (limited to 'rdp/rdp.c')
-rw-r--r-- | rdp/rdp.c | 49 |
1 files changed, 49 insertions, 0 deletions
@@ -53,6 +53,7 @@ lib_mod_connect(struct mod* mod) if (rdp_rdp_connect(mod->rdp_layer, mod->ip, mod->port) == 0) { mod->sck = mod->rdp_layer->sec_layer->mcs_layer->iso_layer->tcp_layer->sck; + mod->sck_obj = g_create_wait_obj_from_socket(mod->sck, 0); DEBUG(("out lib_mod_connect")); return 0; } @@ -209,6 +210,11 @@ lib_mod_end(struct mod* mod) mod->rdp_layer = 0; free_stream(mod->in_s); mod->in_s = 0; + if (mod->sck_obj != 0) + { + g_delete_wait_obj_from_socket(mod->sck_obj); + mod->sck_obj = 0; + } if (mod->sck != 0) { g_tcp_close(mod->sck); @@ -250,6 +256,47 @@ lib_mod_set_param(struct mod* mod, char* name, char* value) } /******************************************************************************/ +/* return error */ +int DEFAULT_CC +lib_mod_get_wait_objs(struct mod* mod, tbus* read_objs, int* rcount, + tbus* write_objs, int* wcount, int* timeout) +{ + int i; + + i = *rcount; + if (mod != 0) + { + if (mod->sck_obj != 0) + { + read_objs[i++] = mod->sck_obj; + } + } + *rcount = i; + return 0; +} + +/******************************************************************************/ +/* return error */ +int DEFAULT_CC +lib_mod_check_wait_objs(struct mod* mod) +{ + int rv; + + rv = 0; + if (mod != 0) + { + if (mod->sck_obj != 0) + { + if (g_is_wait_obj_set(mod->sck_obj)) + { + rv = lib_mod_signal(mod); + } + } + } + return rv; +} + +/******************************************************************************/ struct mod* EXPORT_CC mod_init(void) { @@ -265,6 +312,8 @@ mod_init(void) mod->mod_signal = lib_mod_signal; mod->mod_end = lib_mod_end; mod->mod_set_param = lib_mod_set_param; + mod->mod_get_wait_objs = lib_mod_get_wait_objs; + mod->mod_check_wait_objs = lib_mod_check_wait_objs; mod->rdp_layer = rdp_rdp_create(mod); DEBUG(("out mod_init")); return mod; |