X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=mcs.c;h=cee23643e00473371fc8d4be9a307e7dc7e8b785;hb=908d0bab155aee5757f902486dd1bbba859637f4;hp=9e6740f950022ab63751722393ebf82f16f4efee;hpb=f78d8ca1c22e0fcfabb9383928bc2cf6c93473cd;p=rdpsrv diff --git a/mcs.c b/mcs.c index 9e6740f..cee2364 100644 --- 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 */