]> git.sesse.net Git - rdpsrv/blobdiff - iso.c
Attempt to send an CC back (but fail?)
[rdpsrv] / iso.c
diff --git a/iso.c b/iso.c
index 26e967b384560fbe790d92e047ac8e57e9354d33..905e54a2fbf8b28cfe8953f38ae70cc5c848b11d 100644 (file)
--- a/iso.c
+++ b/iso.c
@@ -182,28 +182,40 @@ iso_recv(void)
        return s;
 }
 
-/* Establish a connection up to the ISO layer */
 BOOL
-iso_connect(char *server, char *username)
+iso_recv_connect(int server_sock)
 {
+       STREAM s;
        uint8 code;
 
-       if (!tcp_connect(server))
-               return False;
-
-       iso_send_connection_request(username);
-
-       if (iso_recv_msg(&code) == NULL)
-               return False;
+       tcp_recv_connect(server_sock);
+       
+       s = iso_recv_msg(&code);
+       if (s == NULL)
+               return 0;
 
-       if (code != ISO_PDU_CC)
+       if (code != ISO_PDU_CR)
        {
-               error("expected CC, got 0x%x\n", code);
-               tcp_disconnect();
-               return False;
+               error("expected CR, got 0x%x\n", code);
+               return 0;
        }
 
-       return True;
+       DEBUG(("Got ISO connection request\n"));
+
+       iso_init(0);
+       
+       /* send an CC PDU back */
+       out_uint8(s, 3);        /* version */
+       out_uint8(s, 0);        /* reserved */
+       out_uint16_be(s, 0);
+
+       out_uint8(s, 2);        /* hdrlen */
+       out_uint8(s, ISO_PDU_CC);       /* code */
+       out_uint8(s, 0x80);     /* eot */
+
+       tcp_send(s);
+       
+       return 1;
 }
 
 /* Disconnect from the ISO layer */