update/fix some debug log calls and add the test of XRDP_DEBUG to make files so controlled by the autoconf option --enable-xrdpdebug

This commit is contained in:
LawrenceK 2012-12-20 09:08:14 +00:00
parent cc03ff6704
commit 4c189ec3b4
7 changed files with 34 additions and 5 deletions

View File

@ -1,10 +1,18 @@
EXTRA_DIST = xrdp-freerdp.h
EXTRA_DEFINES =
if XRDP_DEBUG
EXTRA_DEFINES += -DXRDP_DEBUG
else
EXTRA_DEFINES += -DXRDP_NODEBUG
endif
AM_CFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\"
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
$(EXTRA_DEFINES)
INCLUDES = \
-I$(top_srcdir)/common \

View File

@ -21,7 +21,12 @@
#include "xrdp-color.h"
#include "xrdp_rail.h"
#define LOG_LEVEL 1
#ifdef XRDP_DEBUG
#define LOG_LEVEL 99
#else
#define LOG_LEVEL 0
#endif
#define LLOG(_level, _args) \
do { if (_level < LOG_LEVEL) { g_write _args ; } } while (0)
#define LLOGLN(_level, _args) \

View File

@ -744,6 +744,7 @@ libxrdp_query_channel(struct xrdp_session *session, int index,
if (index < 0 || index >= count)
{
DEBUG(("libxrdp_query_channel - Channel out of range %d", index));
return 1;
}
@ -760,6 +761,7 @@ libxrdp_query_channel(struct xrdp_session *session, int index,
if (channel_name != 0)
{
g_strncpy(channel_name, channel_item->name, 8);
DEBUG(("libxrdp_query_channel - Channel %d name %s", index, channel_name));
}
if (channel_flags != 0)

View File

@ -144,9 +144,9 @@ xrdp_mcs_recv(struct xrdp_mcs *self, struct stream *s, int *chan)
/* this is channels getting added from the client */
if (appid == MCS_CJRQ)
{
g_writeln("channel join request received");
in_uint16_be(s, userid);
in_uint16_be(s, chanid);
g_writeln("channel join request received %d:%d", userid, chanid);
DEBUG(("xrdp_mcs_recv adding channel %4.4x", chanid));
if (xrdp_mcs_send_cjcf(self, userid, chanid) != 0)

View File

@ -454,7 +454,7 @@ xrdp_rdp_send_data(struct xrdp_rdp *self, struct stream *s,
}
else
{
g_writeln("mppc_encode not ok");
g_writeln("mppc_encode not ok: type %d flags %d", mppc_enc->protocol_type, mppc_enc->flags);
}
}

View File

@ -1,10 +1,18 @@
EXTRA_DIST = rdp.h
EXTRA_DEFINES =
if XRDP_DEBUG
EXTRA_DEFINES += -DXRDP_DEBUG
else
EXTRA_DEFINES += -DXRDP_NODEBUG
endif
AM_CFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\"
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
$(EXTRA_DEFINES)
INCLUDES = \
-I$(top_srcdir)/common

View File

@ -305,6 +305,12 @@ main(int argc, char **argv)
g_init("xrdp");
ssl_init();
for (test=0;test<argc; test++)
{
DEBUG(("Argument %i - %s",test,argv[test]));
}
/* check compiled endian with actual endian */
test = 1;
host_be = !((int)(*(unsigned char *)(&test)));