/[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 4 by matty, Wed May 10 07:36:34 2000 UTC revision 7 by matty, Fri Jul 7 09:40:03 2000 UTC
# Line 176  BOOL mcs_recv(HCONN conn, BOOL request) Line 176  BOOL mcs_recv(HCONN conn, BOOL request)
176  {  {
177          MCS_DATA data;          MCS_DATA data;
178    
179          return (iso_recv(conn)) && mcs_io_data(&conn->in, &data, request);          if (!iso_recv(conn) || !mcs_io_data(&conn->in, &data, request))
180                    return False;
181    
182    #ifdef MCS_DEBUG
183            fprintf(stderr, "MCS packet\n");
184            dump_data(conn->in.data+conn->in.offset, conn->in.end-conn->in.offset);
185    #endif
186    
187            conn->in.rdp_offset = conn->in.offset;
188            return True;
189  }  }
190    
191  /* Initialise a DOMAIN_PARAMS structure */  /* Initialise a DOMAIN_PARAMS structure */
# Line 243  BOOL ber_io_header(STREAM s, BOOL islong Line 252  BOOL ber_io_header(STREAM s, BOOL islong
252          BOOL res;          BOOL res;
253    
254          /* Read/write tag */          /* Read/write tag */
255          if (islong) {          if (islong)
256            {
257                  word_tag = tagval;                  word_tag = tagval;
258                  res = msb_io_uint16(s, &word_tag);                  res = msb_io_uint16(s, &word_tag);
259                  tag = word_tag;                  tag = word_tag;
260          } else {          }
261            else
262            {
263                  byte_tag = tagval;                  byte_tag = tagval;
264                  res = prs_io_uint8(s, &byte_tag);                  res = prs_io_uint8(s, &byte_tag);
265                  tag = byte_tag;                  tag = byte_tag;
266          }          }
267    
268          if (!res || (tag != tagval)) {          if (!res || (tag != tagval))
269            {
270                  fprintf(stderr, "Invalid ASN.1 tag\n");                  fprintf(stderr, "Invalid ASN.1 tag\n");
271                  return False;                  return False;
272          }          }
# Line 524  BOOL mcs_io_data(STREAM s, MCS_DATA *dt, Line 537  BOOL mcs_io_data(STREAM s, MCS_DATA *dt,
537  {  {
538          uint8 opcode = (request ? 25 : 26) << 2;          uint8 opcode = (request ? 25 : 26) << 2;
539          uint8 pkt_opcode = opcode;          uint8 pkt_opcode = opcode;
540            uint8 byte1, byte2;
541          BOOL res;          BOOL res;
542    
543          res = prs_io_uint8(s, &pkt_opcode);          res = prs_io_uint8(s, &pkt_opcode);
# Line 538  BOOL mcs_io_data(STREAM s, MCS_DATA *dt, Line 552  BOOL mcs_io_data(STREAM s, MCS_DATA *dt,
552          res = res ? msb_io_uint16(s, &dt->userid) : False;          res = res ? msb_io_uint16(s, &dt->userid) : False;
553          res = res ? msb_io_uint16(s, &dt->chanid) : False;          res = res ? msb_io_uint16(s, &dt->chanid) : False;
554          res = res ? prs_io_uint8 (s, &dt->flags ) : False;          res = res ? prs_io_uint8 (s, &dt->flags ) : False;
555          res = res ? msb_io_uint16(s, &dt->length) : False;  
556            if (s->marshall)
557            {
558                    res = res ? msb_io_uint16(s, &dt->length) : False;
559            }
560            else
561            {
562                    res = res ? prs_io_uint8(s, &byte1) : False;
563                    if (byte1 & 0x80)
564                    {
565                            res = res ? prs_io_uint8(s, &byte2) : False;
566                            dt->length = ((byte1 & ~0x80) << 8) + byte2;
567                    }
568                    else dt->length = byte1;
569            }
570    
571          return res;          return res;
572  }  }
573    

Legend:
Removed from v.4  
changed lines
  Added in v.7

  ViewVC Help
Powered by ViewVC 1.1.26