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

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

revision 730 by jsorg71, Tue Jun 29 16:22:41 2004 UTC revision 733 by jsorg71, Mon Jul 5 19:09:07 2004 UTC
# Line 51  rdp_recv(uint8 * type) Line 51  rdp_recv(uint8 * type)
51  {  {
52          static STREAM rdp_s;          static STREAM rdp_s;
53          uint16 length, pdu_type;          uint16 length, pdu_type;
54            uint8 rdpver;
55    
56          if ((rdp_s == NULL) || (g_next_packet >= rdp_s->end))          if ((rdp_s == NULL) || (g_next_packet >= rdp_s->end))
57          {          {
58                  rdp_s = sec_recv();                  rdp_s = sec_recv(&rdpver);
59                  if (rdp_s == NULL)                  if (rdp_s == NULL)
60                          return NULL;                          return NULL;
61                    if (rdpver != 3)
62                    {
63                            /* rdp5_process should move g_next_packet ok */
64                            rdp5_process(rdp_s);
65                            *type = 0;
66                            return rdp_s;
67                    }
68    
69                  g_next_packet = rdp_s->p;                  g_next_packet = rdp_s->p;
70          }          }
# Line 1135  process_data_pdu(STREAM s, uint32 * ext_ Line 1143  process_data_pdu(STREAM s, uint32 * ext_
1143  }  }
1144    
1145  /* Process incoming packets */  /* Process incoming packets */
1146    /* nevers gets out of here till app is done */
1147  void  void
1148  rdp_main_loop(BOOL * deactivated, uint32 * ext_disc_reason)  rdp_main_loop(BOOL * deactivated, uint32 * ext_disc_reason)
1149  {  {
1150          uint8 type;          while (rdp_loop(deactivated, ext_disc_reason))
1151          BOOL disc = False;      /* True when a disconnect PDU was received */                  ;
         STREAM s;  
   
         while ((s = rdp_recv(&type)) != NULL)  
         {  
                 switch (type)  
                 {  
                         case RDP_PDU_DEMAND_ACTIVE:  
                                 process_demand_active(s);  
                                 *deactivated = False;  
                                 break;  
   
                         case RDP_PDU_DEACTIVATE:  
                                 DEBUG(("RDP_PDU_DEACTIVATE\n"));  
                                 *deactivated = True;  
                                 break;  
   
                         case RDP_PDU_DATA:  
                                 disc = process_data_pdu(s, ext_disc_reason);  
                                 break;  
   
                         case 0:  
                                 break;  
   
                         default:  
                                 unimpl("PDU %d\n", type);  
                 }  
   
                 if (disc)  
                 {  
                         return;  
                 }  
         }  
         return;  
1152  }  }
1153    
1154  /* used in uiports, processes the rdp packets waiting */  /* used in uiports and rdp_main_loop, processes the rdp packets waiting */
1155  BOOL  BOOL
1156  rdp_loop(BOOL * deactivated, uint32 * ext_disc_reason)  rdp_loop(BOOL * deactivated, uint32 * ext_disc_reason)
1157  {  {

Legend:
Removed from v.730  
changed lines
  Added in v.733

  ViewVC Help
Powered by ViewVC 1.1.26