/[rdesktop]/sourceforge.net/trunk/rdesktop/channels.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/channels.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 473 by forsberg, Sat Sep 27 12:14:25 2003 UTC revision 1199 by astrand, Mon Mar 27 08:17:34 2006 UTC
# Line 2  Line 2 
2     rdesktop: A Remote Desktop Protocol client.     rdesktop: A Remote Desktop Protocol client.
3     Protocol services - Virtual channels     Protocol services - Virtual channels
4     Copyright (C) Erik Forsberg <forsberg@cendio.se> 2003     Copyright (C) Erik Forsberg <forsberg@cendio.se> 2003
5     Copyright (C) Matthew Chapman 2003     Copyright (C) Matthew Chapman 2003-2005
6    
7     This program is free software; you can redistribute it and/or modify     This program is free software; you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by     it under the terms of the GNU General Public License as published by
# Line 21  Line 21 
21    
22  #include "rdesktop.h"  #include "rdesktop.h"
23    
24  #define MAX_CHANNELS                    4  #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
# Line 81  channel_send(STREAM s, VCHANNEL * channe Line 81  channel_send(STREAM s, VCHANNEL * channe
81  {  {
82          uint32 length, flags;          uint32 length, flags;
83          uint32 thislength, remaining;          uint32 thislength, remaining;
84          char *data;          uint8 *data;
85    
86          /* first fragment sent in-place */          /* first fragment sent in-place */
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
94     1592, not 1600. However, I don't remember the reason and 1600 seems     1592, not 1600. However, I don't remember the reason and 1600 seems
95     to work so.. This applies only to *this* length, not the length of     to work so.. This applies only to *this* length, not the length of
# Line 102  channel_send(STREAM s, VCHANNEL * channe Line 102  channel_send(STREAM s, VCHANNEL * channe
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) */
# Line 114  channel_send(STREAM s, VCHANNEL * channe Line 114  channel_send(STREAM s, VCHANNEL * channe
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);
# Line 132  channel_process(STREAM s, uint16 mcs_cha Line 132  channel_process(STREAM s, uint16 mcs_cha
132  {  {
133          uint32 length, flags;          uint32 length, flags;
134          uint32 thislength;          uint32 thislength;
135          VCHANNEL *channel;          VCHANNEL *channel = NULL;
136          unsigned int i;          unsigned int i;
137          STREAM in;          STREAM in;
138    
# Line 161  channel_process(STREAM s, uint16 mcs_cha Line 161  channel_process(STREAM s, uint16 mcs_cha
161                  {                  {
162                          if (length > in->size)                          if (length > in->size)
163                          {                          {
164                                  in->data = xrealloc(in->data, length);                                  in->data = (uint8 *) xrealloc(in->data, length);
165                                  in->size = length;                                  in->size = length;
166                          }                          }
167                          in->p = in->data;                          in->p = in->data;

Legend:
Removed from v.473  
changed lines
  Added in v.1199

  ViewVC Help
Powered by ViewVC 1.1.26