Accept ISO CR.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 3 Feb 2005 23:05:24 +0000 (23:05 +0000)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 3 Feb 2005 23:05:24 +0000 (23:05 +0000)
iso.c
proto.h
rdpsrv.c

diff --git a/iso.c b/iso.c
index 9a343ad..c694624 100644 (file)
--- 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 (file)
--- 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);
index 59442eb..86235ec 100644 (file)
--- 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");
        }
 }