From: Steinar H. Gunderson Date: Fri, 4 Feb 2005 17:44:05 +0000 (+0000) Subject: Valgrind fixes, re-request updates all the time. X-Git-Url: https://git.sesse.net/?p=rdpsrv;a=commitdiff_plain;h=dbccf42e4424093cfc0f970d1fcfaad9ae60c954 Valgrind fixes, re-request updates all the time. --- diff --git a/rdp.c b/rdp.c index db74a32..56a0f7c 100644 --- a/rdp.c +++ b/rdp.c @@ -72,7 +72,7 @@ rdp_recv(uint8 * type) #if WITH_DEBUG DEBUG(("RDP packet #%d, (type %x, length %u)\n", ++g_packetno, *type, length)); - hexdump(g_next_packet, length); + //hexdump(g_next_packet, length); #endif /* */ g_next_packet += length; diff --git a/rdpsrv.c b/rdpsrv.c index 5a12193..c838fc7 100644 --- a/rdpsrv.c +++ b/rdpsrv.c @@ -113,6 +113,20 @@ void handle_input_pdu(STREAM s, int vnc_sock) } printf("\n"); } + + // re-request the entire framebuffer + buf[0] = 3; // message type + buf[1] = 1; // incremental + buf[2] = 0; // xpos + buf[3] = 0; + buf[4] = 0; // ypos + buf[5] = 0; + buf[6] = 640 >> 8; // width + buf[7] = 640 & 0xff; + buf[8] = 480 >> 8; // height + buf[9] = 480 & 0xff; + + write(vnc_sock, buf, 10); } struct ServerInitialization { @@ -153,7 +167,7 @@ int vnc_init() if (read(vnc_sock, buf, ntohl(si.name_len)) != ntohl(si.name_len)) error("short read on server name\n"); - printf("Server name is '%*s' (%u bytes)\n", ntohl(si.name_len), buf, ntohl(si.name_len)); +// printf("Server name is '%*s' (%u bytes)\n", ntohl(si.name_len), buf, ntohl(si.name_len)); // we can only accept raw encoding buf[0] = 2; // message type @@ -244,7 +258,7 @@ void handle_vnc_fbupdate(int vnc_sock) dst = smallblock; for (y = 0; y < bh; ++y) { - src = data + ((yt * 64 + (bh + 1 - y)) * width + (xt * 64)) * 4; + src = data + ((yt * 64 + (bh - 1 - y)) * width + (xt * 64)) * 4; for (x = 0; x < bw; ++x) { *dst++ = *src++; *dst++ = *src++;