X-Git-Url: https://git.sesse.net/?p=rdpsrv;a=blobdiff_plain;f=rdpsrv.c;h=c5cb1876fb397e6f608dc8fb9457ce8b8c3215b2;hp=0251a2a24b8edbe6b3dd8ec22946ff06441a283b;hb=99f2e8c32508ab193c1d42221c86cb7fca4be9ab;hpb=411dc381dcdd11dd5c12bbfcfb3f7177075d364e diff --git a/rdpsrv.c b/rdpsrv.c index 0251a2a..c5cb187 100644 --- a/rdpsrv.c +++ b/rdpsrv.c @@ -320,10 +320,11 @@ void handle_vnc_fbupdate(int vnc_sock) } } +int listen_on_vnc = 0; + int serve_client() { int vnc_sock = vnc_init(); - int listen_on_vnc = 0; if (!mcs_recv_connect_initial()) error("MCS_CONNECT_INITIAL recv failed"); @@ -363,6 +364,8 @@ int serve_client() } } + printf("LISTEN_ON_VNC=%u\n", listen_on_vnc); + // activity on VNC socket? if (FD_ISSET(vnc_sock, &readfs) && listen_on_vnc) { unsigned char buf[256]; @@ -389,7 +392,7 @@ int serve_client() error("short read on vnc_sock\n"); if (read(vnc_sock, buf, 4) != 4) error("short read on vnc_sock\n"); - if (read(vnc_sock, (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3], 4) != 4) + if (read(vnc_sock, buf, (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]) != 4) error("short read on vnc_sock\n"); default: