Valgrind fixes, re-request updates all the time.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 4 Feb 2005 17:44:05 +0000 (17:44 +0000)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 4 Feb 2005 17:44:05 +0000 (17:44 +0000)
rdp.c
rdpsrv.c

diff --git a/rdp.c b/rdp.c
index db74a32..56a0f7c 100644 (file)
--- 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;
index 5a12193..c838fc7 100644 (file)
--- 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++;