From: Steinar H. Gunderson Date: Fri, 4 Feb 2005 00:12:56 +0000 (+0000) Subject: Handle EDrq from client. X-Git-Url: https://git.sesse.net/?p=rdpsrv;a=commitdiff_plain;h=908d0bab155aee5757f902486dd1bbba859637f4 Handle EDrq from client. --- 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 */ diff --git a/rdpsrv.c b/rdpsrv.c index c5b4169..577f4a7 100644 --- 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); } }