From d4bb133e346809bf5393c0cdb06b2a422b99dddb Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 3 Feb 2005 23:05:24 +0000 Subject: [PATCH] Accept ISO CR. --- iso.c | 23 +++++++++++++++++++++++ proto.h | 2 +- rdpsrv.c | 4 +++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/iso.c b/iso.c index 9a343ad..c694624 100644 --- a/iso.c +++ b/iso.c @@ -182,6 +182,29 @@ iso_recv(void) return s; } +BOOL +iso_recv_connect(int server_sock) +{ + STREAM s; + uint8 code; + + tcp_recv_connect(server_sock); + + s = iso_recv_msg(&code); + if (s == NULL) + return 0; + + if (code != ISO_PDU_CR) + { + error("expected CR, got 0x%x\n", code); + return 0; + } + + DEBUG(("Got ISO connection request\n")); + + return 1; +} + /* Disconnect from the ISO layer */ void iso_disconnect(void) diff --git a/proto.h b/proto.h index db5e98f..97a628b 100644 --- a/proto.h +++ b/proto.h @@ -32,7 +32,7 @@ int get_current_workarea(uint32 * x, uint32 * y, uint32 * width, uint32 * height STREAM iso_init(int length); void iso_send(STREAM s); STREAM iso_recv(void); -BOOL iso_connect(char *server, char *username); +BOOL iso_recv_connect(int server_sock); void iso_disconnect(void); /* licence.c */ void licence_process(STREAM s); diff --git a/rdpsrv.c b/rdpsrv.c index 59442eb..86235ec 100644 --- a/rdpsrv.c +++ b/rdpsrv.c @@ -16,8 +16,10 @@ int main() { int server_sock = create_server_socket(); for ( ;; ) { - tcp_recv_connect(server_sock); + iso_recv_connect(server_sock); + printf("Got connection.\n"); serve_client(); + printf("Client closed.\n"); } } -- 2.39.5