Give virtual channel debug output its own switch.

git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/branches/seamlessrdp-branch/rdesktop@1195 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
Pierre Ossman 2006-03-24 15:34:32 +00:00
parent 2101ef3081
commit 9fb01276f2
3 changed files with 18 additions and 3 deletions

View File

@ -87,7 +87,7 @@ channel_send(STREAM s, VCHANNEL * channel)
s_pop_layer(s, channel_hdr); s_pop_layer(s, channel_hdr);
length = s->end - s->p - 8; length = s->end - s->p - 8;
DEBUG_CLIPBOARD(("channel_send, length = %d\n", length)); DEBUG_CHANNEL(("channel_send, length = %d\n", length));
thislength = MIN(length, CHANNEL_CHUNK_LENGTH); thislength = MIN(length, CHANNEL_CHUNK_LENGTH);
/* Note: In the original clipboard implementation, this number was /* Note: In the original clipboard implementation, this number was
@ -102,7 +102,7 @@ channel_send(STREAM s, VCHANNEL * channel)
out_uint32_le(s, length); out_uint32_le(s, length);
out_uint32_le(s, flags); out_uint32_le(s, flags);
data = s->end = s->p + thislength; data = s->end = s->p + thislength;
DEBUG_CLIPBOARD(("Sending %d bytes with FLAG_FIRST\n", thislength)); DEBUG_CHANNEL(("Sending %d bytes with FLAG_FIRST\n", thislength));
sec_send_to_channel(s, g_encryption ? SEC_ENCRYPT : 0, channel->mcs_id); sec_send_to_channel(s, g_encryption ? SEC_ENCRYPT : 0, channel->mcs_id);
/* subsequent segments copied (otherwise would have to generate headers backwards) */ /* subsequent segments copied (otherwise would have to generate headers backwards) */
@ -114,7 +114,7 @@ channel_send(STREAM s, VCHANNEL * channel)
if (channel->flags & CHANNEL_OPTION_SHOW_PROTOCOL) if (channel->flags & CHANNEL_OPTION_SHOW_PROTOCOL)
flags |= CHANNEL_FLAG_SHOW_PROTOCOL; flags |= CHANNEL_FLAG_SHOW_PROTOCOL;
DEBUG_CLIPBOARD(("Sending %d bytes with flags %d\n", thislength, flags)); DEBUG_CHANNEL(("Sending %d bytes with flags %d\n", thislength, flags));
s = sec_init(g_encryption ? SEC_ENCRYPT : 0, thislength + 8); s = sec_init(g_encryption ? SEC_ENCRYPT : 0, thislength + 8);
out_uint32_le(s, length); out_uint32_le(s, length);

View File

@ -679,6 +679,15 @@ AC_ARG_WITH(debug-clipboard,
fi fi
]) ])
AC_ARG_WITH(debug-channel,
[ --with-debug-channel enable debugging of virtual channel code],
[
if test $withval != "no";
then
AC_DEFINE(WITH_DEBUG_CHANNEL,1)
fi
])
# #
# target-specific stuff # target-specific stuff

View File

@ -57,6 +57,12 @@
#define DEBUG_CLIPBOARD(args) #define DEBUG_CLIPBOARD(args)
#endif #endif
#ifdef WITH_DEBUG_CHANNEL
#define DEBUG_CHANNEL(args) printf args;
#else
#define DEBUG_CHANNEL(args)
#endif
#define STRNCPY(dst,src,n) { strncpy(dst,src,n-1); dst[n-1] = 0; } #define STRNCPY(dst,src,n) { strncpy(dst,src,n-1); dst[n-1] = 0; }
#ifndef MIN #ifndef MIN