diff options
| author | jsorg71 <jsorg71> | 2009-08-05 06:16:05 +0000 | 
|---|---|---|
| committer | jsorg71 <jsorg71> | 2009-08-05 06:16:05 +0000 | 
| commit | eeac7c938a7602f4e471181aa62b18c206105de8 (patch) | |
| tree | 8aefb09f38b9215394baf9806841c07203994177 | |
| parent | 3cfea6a9596269cf1a0e308ea6653905fa3702bb (diff) | |
| download | xrdp-proprietary-eeac7c938a7602f4e471181aa62b18c206105de8.tar.gz xrdp-proprietary-eeac7c938a7602f4e471181aa62b18c206105de8.zip | |
add extended log output
| -rw-r--r-- | common/list.c | 17 | ||||
| -rw-r--r-- | common/list.h | 2 | ||||
| -rw-r--r-- | common/os_calls.c | 4 | ||||
| -rw-r--r-- | sesman/sesman.c | 7 | ||||
| -rw-r--r-- | xrdp/xrdp_bitmap.c | 6 | ||||
| -rw-r--r-- | xrdp/xrdp_font.c | 2 | ||||
| -rw-r--r-- | xrdp/xrdp_login_wnd.c | 4 | ||||
| -rw-r--r-- | xrdp/xrdp_mm.c | 15 | ||||
| -rw-r--r-- | xrdp/xrdp_wm.c | 10 | 
9 files changed, 60 insertions, 7 deletions
| diff --git a/common/list.c b/common/list.c index b3263a54..953ef676 100644 --- a/common/list.c +++ b/common/list.c @@ -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)); +  } +} diff --git a/common/list.h b/common/list.h index 00c1cfed..7da3ad86 100644 --- a/common/list.h +++ b/common/list.h @@ -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 diff --git a/common/os_calls.c b/common/os_calls.c index e805a09f..5db47447 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -1684,7 +1684,11 @@ g_get_strerror(void)  int APP_CC  g_get_errno(void)  { +#if defined(_WIN32) +  return GetLastError(); +#else    return errno; +#endif  }  /*****************************************************************************/ diff --git a/sesman/sesman.c b/sesman/sesman.c index 186ad4e5..5c640a30 100644 --- a/sesman/sesman.c +++ b/sesman/sesman.c @@ -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);  } diff --git a/xrdp/xrdp_bitmap.c b/xrdp/xrdp_bitmap.c index 11a3a402..1aeda6fd 100644 --- a/xrdp/xrdp_bitmap.c +++ b/xrdp/xrdp_bitmap.c @@ -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;  } diff --git a/xrdp/xrdp_font.c b/xrdp/xrdp_font.c index 55f928ba..783d8225 100644 --- a/xrdp/xrdp_font.c +++ b/xrdp/xrdp_font.c @@ -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); diff --git a/xrdp/xrdp_login_wnd.c b/xrdp/xrdp_login_wnd.c index 6ac8e11d..989c2667 100644 --- a/xrdp/xrdp_login_wnd.c +++ b/xrdp/xrdp_login_wnd.c @@ -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++)    { diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c index 7d41a2aa..901b49af 100644 --- a/xrdp/xrdp_mm.c +++ b/xrdp/xrdp_mm.c @@ -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) diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c index 4936cc70..1bdc961f 100644 --- a/xrdp/xrdp_wm.c +++ b/xrdp/xrdp_wm.c @@ -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    { | 
