diff options
author | ArvidNorr <norrarvid@gmail.com> | 2013-01-31 11:22:43 -0800 |
---|---|---|
committer | ArvidNorr <norrarvid@gmail.com> | 2013-01-31 11:22:43 -0800 |
commit | 72c99794ee6d2811ba9c85d76e1f30f2309ac7d8 (patch) | |
tree | a76dc3599dea4ecc8d4a7a6369ab3b0873547dc1 /xrdp/xrdp_mm.c | |
parent | 9aa0cb4e61eeb253a9a1177f1162eb5289130e96 (diff) | |
parent | fb7294ed26d28b12d8da5cf5f41f5975f1999f04 (diff) | |
download | xrdp-proprietary-72c99794ee6d2811ba9c85d76e1f30f2309ac7d8.tar.gz xrdp-proprietary-72c99794ee6d2811ba9c85d76e1f30f2309ac7d8.zip |
Merge pull request #59 from ArvidNorr/morelogging
More logging for debug and trace.
Diffstat (limited to 'xrdp/xrdp_mm.c')
-rw-r--r-- | xrdp/xrdp_mm.c | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c index 90127c4b..9b6ff5e7 100644 --- a/xrdp/xrdp_mm.c +++ b/xrdp/xrdp_mm.c @@ -64,7 +64,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"); + log_message(LOG_LEVEL_DEBUG,"xrdp_mm_module_cleanup"); if (self->mod != 0) { @@ -325,6 +325,7 @@ xrdp_mm_setup_mod1(struct xrdp_mm *self) g_snprintf(text, 255, "error finding proc mod_init in %s, not a valid " "xrdp backend", lib); xrdp_wm_log_msg(self->wm, text); + log_message(LOG_LEVEL_ERROR,text); } self->mod_init = (struct xrdp_mod * ( *)(void))func; @@ -340,6 +341,7 @@ xrdp_mm_setup_mod1(struct xrdp_mm *self) g_snprintf(text, 255, "error finding proc mod_exit in %s, not a valid " "xrdp backend", lib); xrdp_wm_log_msg(self->wm, text); + log_message(LOG_LEVEL_ERROR,text); } self->mod_exit = (int ( *)(struct xrdp_mod *))func; @@ -356,7 +358,7 @@ xrdp_mm_setup_mod1(struct xrdp_mm *self) } else { - g_writeln("no mod_init or mod_exit address found"); + log_message(LOG_LEVEL_ERROR,"no mod_init or mod_exit address found"); } } else @@ -364,6 +366,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); + log_message(LOG_LEVEL_ERROR,text); return 1; } @@ -703,7 +706,7 @@ xrdp_mm_chan_process_msg(struct xrdp_mm *self, struct trans *trans, rv = xrdp_mm_trans_process_channel_data(self, trans); break; default: - g_writeln("xrdp_mm_chan_process_msg: unknown id %d", id); + log_message(LOG_LEVEL_ERROR,"xrdp_mm_chan_process_msg: unknown id %d", id); break; } @@ -812,26 +815,27 @@ xrdp_mm_connect_chansrv(struct xrdp_mm *self, char *ip, char *port) } g_sleep(1000); - g_writeln("xrdp_mm_connect_chansrv: connect failed " + log_message(LOG_LEVEL_ERROR,"xrdp_mm_connect_chansrv: connect failed " "trying again..."); } if (!(self->chan_trans_up)) { - g_writeln("xrdp_mm_connect_chansrv: error in trans_connect " - "chan"); + log_message(LOG_LEVEL_ERROR,"xrdp_mm_connect_chansrv: error in" + "trans_connect chan"); } if (self->chan_trans_up) { if (xrdp_mm_chan_send_init(self) != 0) { - g_writeln("xrdp_mm_connect_chansrv: error in " + log_message(LOG_LEVEL_ERROR,"xrdp_mm_connect_chansrv: error in " "xrdp_mm_chan_send_init"); } else { - g_writeln("xrdp_mm_connect_chansrv: chansrv connect successful"); + log_message(LOG_LEVEL_DEBUG,"xrdp_mm_connect_chansrv: chansrv" + "connect successful"); } } @@ -898,6 +902,8 @@ xrdp_mm_process_login_response(struct xrdp_mm *self, struct stream *s) { xrdp_wm_log_msg(self->wm, "xrdp_mm_process_login_response: " "login failed"); + log_message(LOG_LEVEL_INFO,"xrdp_mm_process_login_response: " + "login failed"); } cleanup_sesman_connection(self); @@ -993,7 +999,7 @@ xrdp_mm_process_channel_data(struct xrdp_mm *self, tbus param1, tbus param2, if (total_length < length) { - g_writeln("WARNING in xrdp_mm_process_channel_data(): total_len < length"); + log_message(LOG_LEVEL_DEBUG,"WARNING in xrdp_mm_process_channel_data(): total_len < length"); total_length = length; } @@ -1055,7 +1061,7 @@ xrdp_mm_sesman_data_in(struct trans *trans) break; default: xrdp_wm_log_msg(self->wm, "An undefined reply code was received from sesman"); - g_writeln("Fatal xrdp_mm_sesman_data_in: unknown cmd code %d", code); + log_message(LOG_LEVEL_ERROR,"Fatal xrdp_mm_sesman_data_in: unknown cmd code %d", code); cleanup_sesman_connection(self); break; } @@ -1501,6 +1507,7 @@ xrdp_mm_connect(struct xrdp_mm *self) g_snprintf(errstr, 255, "Failure to connect to sesman: %s port: %s", ip, port); xrdp_wm_log_msg(self->wm, errstr); + log_message(LOG_LEVEL_ERROR,errstr); trans_delete(self->sesman_trans); self->sesman_trans = 0; self->sesman_trans_up = 0; @@ -1520,13 +1527,14 @@ xrdp_mm_connect(struct xrdp_mm *self) { /* connect error */ g_snprintf(errstr, 255, "Failure to connect to: %s", ip); + log_message(LOG_LEVEL_ERROR,errstr); xrdp_wm_log_msg(self->wm, errstr); rv = 1; /* failure */ } } else { - g_writeln("Failure setting up module"); + log_message(LOG_LEVEL_ERROR,"Failure setting up module"); } if (self->wm->login_mode != 10) @@ -1544,7 +1552,7 @@ xrdp_mm_connect(struct xrdp_mm *self) xrdp_mm_connect_chansrv(self, "", chansrvport); } - g_writeln("returnvalue from xrdp_mm_connect %d", rv); + log_message(LOG_LEVEL_DEBUG,"returnvalue from xrdp_mm_connect %d", rv); return rv; } @@ -2096,7 +2104,7 @@ int read_allowed_channel_names(struct list *names, struct list *values) } else { - g_writeln("Failure reading channel section of configuration"); + log_message(LOG_LEVEL_ERROR,"Failure reading channel section of configuration"); } g_file_close(fd); @@ -2176,7 +2184,7 @@ is_channel_enabled(char *inName, struct list *names, struct list *values) reply = text2bool(val); if (reply == 0) { - g_writeln("This channel is disabled: %s", name); + log_message(LOG_LEVEL_INFO,"This channel is disabled: %s", name); } } @@ -2230,7 +2238,7 @@ void init_channel_allowed(struct xrdp_wm *wm) } else { - g_writeln("The following channel is not allowed: %s (%d)", channelname, index); + log_message(LOG_LEVEL_INFO,"The following channel is not allowed: %s (%d)", channelname, index); } index++; @@ -2240,7 +2248,7 @@ void init_channel_allowed(struct xrdp_wm *wm) } else { - g_writeln("Error reading channel section in inifile"); + log_message(LOG_LEVEL_ERROR,"Error reading channel section in inifile"); } list_delete(names); @@ -2365,7 +2373,7 @@ server_create_os_surface(struct xrdp_mod *mod, int rdpindex, if (error != 0) { - g_writeln("server_create_os_surface: xrdp_cache_add_os_bitmap failed"); + log_message(LOG_LEVEL_ERROR,"server_create_os_surface: xrdp_cache_add_os_bitmap failed"); return 1; } @@ -2416,7 +2424,7 @@ server_switch_os_surface(struct xrdp_mod *mod, int rdpindex) } else { - g_writeln("server_switch_os_surface: error finding id %d", rdpindex); + log_message(LOG_LEVEL_ERROR,"server_switch_os_surface: error finding id %d", rdpindex); } return 0; @@ -2479,7 +2487,7 @@ server_paint_rect_os(struct xrdp_mod *mod, int x, int y, int cx, int cy, } else { - g_writeln("server_paint_rect_os: error finding id %d", rdpindex); + log_message(LOG_LEVEL_ERROR,"server_paint_rect_os: error finding id %d", rdpindex); } return 0; |