/[rdesktop]/sourceforge.net/trunk/rdesktop/mcs.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/mcs.c

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

revision 381 by jsorg71, Fri May 30 21:59:56 2003 UTC revision 409 by forsberg, Fri Jun 6 10:46:00 2003 UTC
# Line 256  mcs_send_cjrq(uint16 chanid) Line 256  mcs_send_cjrq(uint16 chanid)
256  {  {
257          STREAM s;          STREAM s;
258    
259            DEBUG_RDP5(("Sending CJRQ for channel #%d\n", chanid));
260    
261          s = iso_init(5);          s = iso_init(5);
262    
263          out_uint8(s, (MCS_CJRQ << 2));          out_uint8(s, (MCS_CJRQ << 2));
# Line 310  mcs_init(int length) Line 312  mcs_init(int length)
312          return s;          return s;
313  }  }
314    
315  /* Send an MCS transport data packet */  /* Send an MCS transport data packet to a specific channel */
316  void  void
317  mcs_send(STREAM s)  mcs_send_to_channel(STREAM s, uint16 channel)
318  {  {
319          uint16 length;          uint16 length;
320    
# Line 322  mcs_send(STREAM s) Line 324  mcs_send(STREAM s)
324    
325          out_uint8(s, (MCS_SDRQ << 2));          out_uint8(s, (MCS_SDRQ << 2));
326          out_uint16_be(s, g_mcs_userid);          out_uint16_be(s, g_mcs_userid);
327          out_uint16_be(s, MCS_GLOBAL_CHANNEL);          out_uint16_be(s, channel);
328          out_uint8(s, 0x70);     /* flags */          out_uint8(s, 0x70);     /* flags */
329          out_uint16_be(s, length);          out_uint16_be(s, length);
330    
331          iso_send(s);          iso_send(s);
332  }  }
333    
334    /* Send an MCS transport data packet to the global channel */
335    void
336    mcs_send(STREAM s)
337    {
338            mcs_send_to_channel(s, MCS_GLOBAL_CHANNEL);
339    }
340    
341  /* Receive an MCS transport data packet */  /* Receive an MCS transport data packet */
342  STREAM  STREAM
343  mcs_recv(uint16 * channel)  mcs_recv(uint16 * channel)
# Line 365  mcs_recv(uint16 * channel) Line 374  mcs_recv(uint16 * channel)
374  BOOL  BOOL
375  mcs_connect(char *server, STREAM mcs_data, char *username)  mcs_connect(char *server, STREAM mcs_data, char *username)
376  {  {
377            uint16 num_channels, i;
378            rdp5_channel *channel;
379          if (!iso_connect(server, username))          if (!iso_connect(server, username))
380                  return False;                  return False;
381    
# Line 378  mcs_connect(char *server, STREAM mcs_dat Line 389  mcs_connect(char *server, STREAM mcs_dat
389          if (!mcs_recv_aucf(&g_mcs_userid))          if (!mcs_recv_aucf(&g_mcs_userid))
390                  goto error;                  goto error;
391    
392          mcs_send_cjrq(g_mcs_userid + 1001);          mcs_send_cjrq(g_mcs_userid + MCS_USERCHANNEL_BASE);
393    
394          if (!mcs_recv_cjcf())          if (!mcs_recv_cjcf())
395                  goto error;                  goto error;
396    
# Line 388  mcs_connect(char *server, STREAM mcs_dat Line 400  mcs_connect(char *server, STREAM mcs_dat
400    
401          if (use_rdp5)          if (use_rdp5)
402          {          {
403                  /* Note: If we send this cjrq after telling the server we support RDP4 only,                  num_channels = get_num_channels();
404                     the server won't respond with a cjcf and we will hang. */                  for (i = 0; i < num_channels; i++)
405                  mcs_send_cjrq(MCS_GLOBAL_CHANNEL + 1);  /* hack - clipboard */                  {
406                  if (!mcs_recv_cjcf())                          channel = find_channel_by_num(i);
407                          goto error;                          mcs_send_cjrq(channel->channelno);
408                            if (!mcs_recv_cjcf())
409                                    goto error;
410                    }
411          }          }
412    
413          return True;          return True;

Legend:
Removed from v.381  
changed lines
  Added in v.409

  ViewVC Help
Powered by ViewVC 1.1.26