21 |
|
|
22 |
#include "rdesktop.h" |
#include "rdesktop.h" |
23 |
|
|
24 |
#define MAX_CHANNELS 5 |
#define MAX_CHANNELS 6 |
25 |
#define CHANNEL_CHUNK_LENGTH 1600 |
#define CHANNEL_CHUNK_LENGTH 1600 |
26 |
#define CHANNEL_FLAG_FIRST 0x01 |
#define CHANNEL_FLAG_FIRST 0x01 |
27 |
#define CHANNEL_FLAG_LAST 0x02 |
#define CHANNEL_FLAG_LAST 0x02 |
87 |
s_pop_layer(s, channel_hdr); |
s_pop_layer(s, channel_hdr); |
88 |
length = s->end - s->p - 8; |
length = s->end - s->p - 8; |
89 |
|
|
90 |
DEBUG_CLIPBOARD(("channel_send, length = %d\n", length)); |
DEBUG_CHANNEL(("channel_send, length = %d\n", length)); |
91 |
|
|
92 |
thislength = MIN(length, CHANNEL_CHUNK_LENGTH); |
thislength = MIN(length, CHANNEL_CHUNK_LENGTH); |
93 |
/* Note: In the original clipboard implementation, this number was |
/* Note: In the original clipboard implementation, this number was |
102 |
out_uint32_le(s, length); |
out_uint32_le(s, length); |
103 |
out_uint32_le(s, flags); |
out_uint32_le(s, flags); |
104 |
data = s->end = s->p + thislength; |
data = s->end = s->p + thislength; |
105 |
DEBUG_CLIPBOARD(("Sending %d bytes with FLAG_FIRST\n", thislength)); |
DEBUG_CHANNEL(("Sending %d bytes with FLAG_FIRST\n", thislength)); |
106 |
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); |
107 |
|
|
108 |
/* subsequent segments copied (otherwise would have to generate headers backwards) */ |
/* subsequent segments copied (otherwise would have to generate headers backwards) */ |
114 |
if (channel->flags & CHANNEL_OPTION_SHOW_PROTOCOL) |
if (channel->flags & CHANNEL_OPTION_SHOW_PROTOCOL) |
115 |
flags |= CHANNEL_FLAG_SHOW_PROTOCOL; |
flags |= CHANNEL_FLAG_SHOW_PROTOCOL; |
116 |
|
|
117 |
DEBUG_CLIPBOARD(("Sending %d bytes with flags %d\n", thislength, flags)); |
DEBUG_CHANNEL(("Sending %d bytes with flags %d\n", thislength, flags)); |
118 |
|
|
119 |
s = sec_init(g_encryption ? SEC_ENCRYPT : 0, thislength + 8); |
s = sec_init(g_encryption ? SEC_ENCRYPT : 0, thislength + 8); |
120 |
out_uint32_le(s, length); |
out_uint32_le(s, length); |