mirror of https://github.com/neutrinolabs/xrdp
add extended log output
This commit is contained in:
parent
3cfea6a959
commit
eeac7c938a
|
@ -199,3 +199,20 @@ list_append_list_strdup(struct list* self, struct list* dest, int start_index)
|
|||
list_add_item(dest, (tbus)dup);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void APP_CC
|
||||
list_dump_items(struct list* self)
|
||||
{
|
||||
int index;
|
||||
tbus item;
|
||||
|
||||
if (self->count == 0)
|
||||
{
|
||||
g_writeln("List is empty");
|
||||
}
|
||||
for (index = 0; index < self->count; index++)
|
||||
{
|
||||
g_writeln("%d: %s", index, list_get_item(self, index));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,5 +55,7 @@ void APP_CC
|
|||
list_insert_item(struct list* self, int index, tbus item);
|
||||
void APP_CC
|
||||
list_append_list_strdup(struct list* self, struct list* dest, int start_index);
|
||||
void APP_CC
|
||||
list_dump_items(struct list* self);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1684,7 +1684,11 @@ g_get_strerror(void)
|
|||
int APP_CC
|
||||
g_get_errno(void)
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
return GetLastError();
|
||||
#else
|
||||
return errno;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -114,12 +114,15 @@ sesman_main_loop(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
log_message(&(g_cfg->log), LOG_LEVEL_ERROR, "listen error");
|
||||
log_message(&(g_cfg->log), LOG_LEVEL_ERROR, "listen error %d (%s)",
|
||||
g_get_errno(), g_get_strerror());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
log_message(&(g_cfg->log), LOG_LEVEL_ERROR, "bind error");
|
||||
log_message(&(g_cfg->log), LOG_LEVEL_ERROR, "bind error on "
|
||||
"port '%s': %d (%s)", g_cfg->listen_port,
|
||||
g_get_errno(), g_get_strerror());
|
||||
}
|
||||
g_tcp_close(g_sck);
|
||||
}
|
||||
|
|
|
@ -448,6 +448,12 @@ xrdp_bitmap_load(struct xrdp_bitmap* self, const char* filename, int* palette)
|
|||
}
|
||||
g_file_close(fd);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_writeln("xrdp_bitmap_load: error loading bitmap from file [%s]",
|
||||
filename);
|
||||
return 1;
|
||||
}
|
||||
free_stream(s);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -88,6 +88,8 @@ xrdp_font_create(struct xrdp_wm* wm)
|
|||
file_size = g_file_get_size(file_path);
|
||||
if (file_size < 1)
|
||||
{
|
||||
g_writeln("xrdp_font_create: error reading font from file [%s]",
|
||||
file_path);
|
||||
return 0;
|
||||
}
|
||||
self = (struct xrdp_font*)g_malloc(sizeof(struct xrdp_font), 1);
|
||||
|
|
|
@ -401,6 +401,10 @@ xrdp_wm_login_fill_in_combo(struct xrdp_wm* self, struct xrdp_bitmap* b)
|
|||
section_values->auto_free = 1;
|
||||
g_snprintf(cfg_file, 255, "%s/xrdp.ini", XRDP_CFG_PATH);
|
||||
fd = g_file_open(cfg_file); /* xrdp.ini */
|
||||
if (fd < 1)
|
||||
{
|
||||
g_writeln("Could not read xrdp ini file %s", cfg_file);
|
||||
}
|
||||
file_read_sections(fd, sections);
|
||||
for (i = 0; i < sections->count; i++)
|
||||
{
|
||||
|
|
|
@ -309,13 +309,15 @@ xrdp_mm_setup_mod1(struct xrdp_mm* self)
|
|||
lib[0] = 0;
|
||||
if (xrdp_mm_get_lib(self, lib, 255) != 0)
|
||||
{
|
||||
g_snprintf(text, 255, "error finding lib");
|
||||
g_snprintf(text, 255, "no library name specified in xrdp.ini, please add "
|
||||
"lib=libxrdp-vnc.so or similar");
|
||||
xrdp_wm_log_msg(self->wm, text);
|
||||
return 1;
|
||||
}
|
||||
if (lib[0] == 0)
|
||||
{
|
||||
g_snprintf(text, 255, "error finding lib");
|
||||
g_snprintf(text, 255, "empty library name specified in xrdp.ini, please "
|
||||
"add lib=libxrdp-vnc.so or similar");
|
||||
xrdp_wm_log_msg(self->wm, text);
|
||||
return 1;
|
||||
}
|
||||
|
@ -331,7 +333,8 @@ xrdp_mm_setup_mod1(struct xrdp_mm* self)
|
|||
}
|
||||
if (func == 0)
|
||||
{
|
||||
g_snprintf(text, 255, "error finding proc mod_init in %s", lib);
|
||||
g_snprintf(text, 255, "error finding proc mod_init in %s, not a valid "
|
||||
"xrdp backend", lib);
|
||||
xrdp_wm_log_msg(self->wm, text);
|
||||
}
|
||||
self->mod_init = (struct xrdp_mod* (*)(void))func;
|
||||
|
@ -342,7 +345,8 @@ xrdp_mm_setup_mod1(struct xrdp_mm* self)
|
|||
}
|
||||
if (func == 0)
|
||||
{
|
||||
g_snprintf(text, 255, "error finding proc mod_exit in %s", lib);
|
||||
g_snprintf(text, 255, "error finding proc mod_exit in %s, not a valid "
|
||||
"xrdp backend", lib);
|
||||
xrdp_wm_log_msg(self->wm, text);
|
||||
}
|
||||
self->mod_exit = (int (*)(struct xrdp_mod*))func;
|
||||
|
@ -353,7 +357,8 @@ xrdp_mm_setup_mod1(struct xrdp_mm* self)
|
|||
}
|
||||
else
|
||||
{
|
||||
g_snprintf(text, 255, "error loading %s", lib);
|
||||
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);
|
||||
}
|
||||
if (self->mod != 0)
|
||||
|
|
|
@ -197,6 +197,12 @@ xrdp_wm_load_pointer(struct xrdp_wm* self, char* file_name, char* data,
|
|||
make_stream(fs);
|
||||
init_stream(fs, 8192);
|
||||
fd = g_file_open(file_name);
|
||||
if (fd < 1)
|
||||
{
|
||||
g_writeln("xrdp_wm_load_pointer: error loading pointer from file [%s]",
|
||||
file_name);
|
||||
return 1;
|
||||
}
|
||||
g_file_read(fd, fs->data, 8192);
|
||||
g_file_close(fd);
|
||||
in_uint8s(fs, 6);
|
||||
|
@ -440,6 +446,10 @@ xrdp_wm_init(struct xrdp_wm* self)
|
|||
list_delete(values);
|
||||
g_file_close(fd);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_writeln("xrdp_wm_init: Could not read xrdp.ini file %s", cfg_file);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue