]> git.sesse.net Git - rdpsrv/blobdiff - mcs.c
Handle EDrq from client.
[rdpsrv] / mcs.c
diff --git a/mcs.c b/mcs.c
index 9e6740f950022ab63751722393ebf82f16f4efee..cee23643e00473371fc8d4be9a307e7dc7e8b785 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 */