From: Steinar H. Gunderson Date: Fri, 4 Feb 2005 16:31:10 +0000 (+0000) Subject: Various hacks to try to make stuff work (still failing). X-Git-Url: https://git.sesse.net/?p=rdpsrv;a=commitdiff_plain;h=25e1484eafa79fa2b644af1d923513b549c6bfd9 Various hacks to try to make stuff work (still failing). --- diff --git a/rdpsrv.c b/rdpsrv.c index edb6299..432147b 100644 --- a/rdpsrv.c +++ b/rdpsrv.c @@ -159,9 +159,9 @@ int vnc_init() buf[3] = 0; buf[4] = 0; // ypos buf[5] = 0; - buf[6] = 640 >> 8; // width + buf[6] = 0; // width buf[7] = 640 % 0xff; - buf[8] = 480 >> 8; // height + buf[8] = 0; // height buf[9] = 480 % 0xff; write(vnc_sock, buf, 10); @@ -208,7 +208,7 @@ void handle_vnc_fbupdate(int vnc_sock) data_left -= ret; } - rdp_send_bitmap_update(ntohs(rect.x), ntohs(rect.y), ntohs(rect.width), ntohs(rect.height), data); +// rdp_send_bitmap_update(ntohs(rect.x), ntohs(rect.y), ntohs(rect.width), ntohs(rect.height), data); xfree(data); } } @@ -216,6 +216,7 @@ void handle_vnc_fbupdate(int vnc_sock) int serve_client() { int vnc_sock = vnc_init(); + int listen_on_vnc = 0; if (!mcs_recv_connect_initial()) error("MCS_CONNECT_INITIAL recv failed"); @@ -248,6 +249,7 @@ int serve_client() case RDP_DATA_PDU_INPUT: printf("Input PDU\n"); handle_input_pdu(s); + listen_on_vnc = 1; break; default: printf("Unknown data PDU type %u\n", data_pdu_type); @@ -256,20 +258,22 @@ int serve_client() } // activity on VNC socket? - if (FD_ISSET(vnc_sock, &readfs)) { + if (FD_ISSET(vnc_sock, &readfs) && listen_on_vnc) { unsigned char buf[256]; printf("Activity on VNC socket!\n"); - read(vnc_sock, buf, 2); + if (read(vnc_sock, buf, 2) != 2) + error("short read on vnc_sock\n"); + switch (buf[0]) { case 0: // frame buffer update! handle_vnc_fbupdate(vnc_sock); break; default: - printf("Unknown server message %x\n", buf[0]); - exit(1); + printf("Unknown VNC server message %x\n", buf[0]); +// exit(1); } } }