Handle EDrq from client.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 4 Feb 2005 00:12:56 +0000 (00:12 +0000)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 4 Feb 2005 00:12:56 +0000 (00:12 +0000)
mcs.c
rdpsrv.c

diff --git a/mcs.c b/mcs.c
index 9e6740f..cee2364 100644 (file)
--- a/mcs.c
+++ b/mcs.c
@@ -180,7 +180,7 @@ mcs_send_connect_response()
        // aiee, no crypto info yet! :-)
        
        s_mark_end(s);
-       printf("LEN: %u\n", s->p - s->data);
+       printf("LEN: %u\n", s->p - s->iso_hdr);
        iso_send(s);
 
 }
@@ -347,23 +347,28 @@ mcs_recv(uint16 * channel)
 
        in_uint8(s, opcode);
        appid = opcode >> 2;
-       if (appid != MCS_SDIN)
-       {
-               if (appid != MCS_DPUM)
-               {
-                       error("expected data, got %d\n", opcode);
-               }
+
+       switch (appid) {
+       case MCS_SDIN:
+               in_uint8s(s, 2);        /* userid */
+               in_uint16_be(s, *channel);
+               in_uint8s(s, 1);        /* flags */
+               in_uint8(s, length);
+               if (length & 0x80)
+                       in_uint8s(s, 1);        /* second byte of length */
+
+               return s;
+       case MCS_DPUM:
+               return NULL;
+       case MCS_EDRQ:
+               // Erect Domain (ignore)
+               printf("Received EDrq\n");
+               return NULL;
+       default:
+               error("expected data, got %d\n", opcode);
                return NULL;
        }
 
-       in_uint8s(s, 2);        /* userid */
-       in_uint16_be(s, *channel);
-       in_uint8s(s, 1);        /* flags */
-       in_uint8(s, length);
-       if (length & 0x80)
-               in_uint8s(s, 1);        /* second byte of length */
-
-       return s;
 }
 
 /* Disconnect from the MCS layer */
index c5b4169..577f4a7 100644 (file)
--- a/rdpsrv.c
+++ b/rdpsrv.c
@@ -67,10 +67,11 @@ int serve_client()
        
        for ( ;; ) {
                short channel;
+               STREAM *s;
                
                /* receive ISO packets */
-               mcs_recv(&channel);
-
-               printf("Packet on ch %u\n", channel);
+               s = mcs_recv(&channel);
+               if (s != NULL)
+                       printf("Packet on ch %u\n", channel);
        }
 }