From 1b90deeef5479b719d10e3b8730677dba68d9b3f Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Thu, 22 Jul 2010 11:35:26 -0500 Subject: [PATCH 1/5] Turn off firebug-lite in canvas test page. --- tests/canvas.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/canvas.html b/tests/canvas.html index bd1a363..e762acd 100644 --- a/tests/canvas.html +++ b/tests/canvas.html @@ -1,9 +1,10 @@ Canvas Performance Test - + From 11304584ca39564a5b28dd599e974acf62bd15a0 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Fri, 23 Jul 2010 09:25:16 -0500 Subject: [PATCH 2/5] README.md: Add more bug/issue suggested info. --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5a26a7d..1b35304 100644 --- a/README.md +++ b/README.md @@ -227,6 +227,9 @@ tab. With firefox+firebug, it can be activated using Ctrl+F12. Now reproduce the problem. The console log output will give more information about what is going wrong and where in the code the -problem is located. If you file a issue/bug, it can be very helpful to -copy the last page of console output leading up the problem into the -issue report. +problem is located. + +If you file a issue/bug, it is very helpful for me to have the last +page of console output leading up the problem in the issue report. +Other helpful issue/bug information: browser version, OS version, +noVNC git version, and VNC server name/version. From 42b2246c1ab34213661d8f616fcda8c1141acba7 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Fri, 23 Jul 2010 11:46:41 -0500 Subject: [PATCH 3/5] Issue #15: noVNC falls behind. noVNC was never processing more than one framebufferUpdate message per onmessage event. If noVNC receives an incomplete framebufferUpdate and then receives the rest of the framebufferUpdate plus another complete framebufferUpdate, then it will fall permanently behind. If there is more to process after a completed framebufferUpdate, then execute normal_msg again. All the render routines must return false if there is not enough data in the receive queue to process their current update, and true otherwise. --- include/rfb.js | 51 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/include/rfb.js b/include/rfb.js index ab0aacf..fe92a77 100644 --- a/include/rfb.js +++ b/include/rfb.js @@ -509,7 +509,7 @@ normal_msg: function () { } switch (msg_type) { case 0: // FramebufferUpdate - ret = RFB.framebufferUpdate(); + ret = RFB.framebufferUpdate(); // false means need more data break; case 1: // SetColourMapEntries Util.Debug("SetColourMapEntries"); @@ -587,7 +587,13 @@ framebufferUpdate: function() { } } - while ((FBU.rects > 0) && (RQ.length >= FBU.bytes)) { + while (FBU.rects > 0) { + if (RFB.state !== "normal") { + return false; + } + if (RQ.length < FBU.bytes) { + return false; + } if (FBU.bytes === 0) { if (RQ.length < 12) { //Util.Debug(" waiting for rect header bytes"); @@ -624,6 +630,7 @@ framebufferUpdate: function() { last_bytes = RQ.length; last_rects = FBU.rects; + // false ret means need more data ret = RFB.encHandlers[FBU.encoding](); now = (new Date()).getTime(); @@ -662,8 +669,6 @@ framebufferUpdate: function() { timing.fbu_rt_start = 0; } } - - if (RFB.state !== "normal") { return true; } } return ret; }, @@ -684,7 +689,7 @@ display_raw: function () { if (RQ.length < FBU.bytes) { //Util.Debug(" waiting for " + // (FBU.bytes - RQ.length) + " RAW bytes"); - return; + return false; } cur_y = FBU.y + (FBU.height - FBU.lines); cur_height = Math.min(FBU.lines, @@ -699,6 +704,7 @@ display_raw: function () { FBU.rects -= 1; FBU.bytes = 0; } + return true; }, display_copy_rect: function () { @@ -709,13 +715,14 @@ display_copy_rect: function () { if (RQ.length < 4) { //Util.Debug(" waiting for " + // (FBU.bytes - RQ.length) + " COPYRECT bytes"); - return; + return false; } old_x = RQ.shift16(); old_y = RQ.shift16(); Canvas.copyImage(old_x, old_y, FBU.x, FBU.y, FBU.width, FBU.height); FBU.rects -= 1; FBU.bytes = 0; + return true; }, display_rre: function () { @@ -725,7 +732,7 @@ display_rre: function () { if (RQ.length < 4 + RFB.fb_Bpp) { //Util.Debug(" waiting for " + // (4 + RFB.fb_Bpp - RQ.length) + " RRE bytes"); - return; + return false; } FBU.subrects = RQ.shift32(); color = RQ.shiftBytes(RFB.fb_Bpp); // Background @@ -751,6 +758,7 @@ display_rre: function () { FBU.bytes = 0; } //Util.Debug("<< display_rre, FBU.bytes: " + FBU.bytes); + return true; }, display_hextile: function() { @@ -771,14 +779,14 @@ display_hextile: function() { FBU.bytes = 1; if (RQ.length < FBU.bytes) { //Util.Debug(" waiting for HEXTILE subencoding byte"); - return; + return false; } subencoding = RQ[0]; // Peek if (subencoding > 30) { // Raw RFB.updateState('failed', "Disconnected: illegal hextile subencoding " + subencoding); //Util.Debug("RQ.slice(0,30):" + RQ.slice(0,30)); - return; + return false; } subrects = 0; cur_tile = FBU.total_tiles - FBU.tiles; @@ -805,7 +813,7 @@ display_hextile: function() { if (RQ.length < FBU.bytes) { /* Wait for subrects byte */ //Util.Debug(" waiting for hextile subrects header byte"); - return; + return false; } subrects = RQ[FBU.bytes-1]; // Peek if (subencoding & 0x10) { // SubrectsColoured @@ -827,7 +835,7 @@ display_hextile: function() { if (RQ.length < FBU.bytes) { //Util.Debug(" waiting for " + // (FBU.bytes - RQ.length) + " hextile bytes"); - return; + return false; } /* We know the encoding and have a whole tile */ @@ -889,6 +897,7 @@ display_hextile: function() { } //Util.Debug("<< display_hextile"); + return true; }, @@ -904,7 +913,7 @@ display_tight_png: function() { FBU.bytes = 1; // compression-control byte if (RQ.length < FBU.bytes) { Util.Debug(" waiting for TIGHT compression-control byte"); - return; + return false; } // Get 'compact length' header and data size @@ -938,7 +947,7 @@ display_tight_png: function() { if (RQ.length < FBU.bytes) { Util.Debug(" waiting for TIGHT " + cmode + " bytes"); - return; + return false; } //Util.Debug(" RQ.slice(0,20): " + RFB.RQ.slice(0,20) + " (" + RFB.RQ.length + ")"); @@ -957,7 +966,7 @@ display_tight_png: function() { FBU.bytes = 1 + clength[0] + clength[1]; // ctl + clength size + jpeg-data if (RQ.length < FBU.bytes) { Util.Debug(" waiting for TIGHT " + cmode + " bytes"); - return; + return false; } // We have everything, render it @@ -976,6 +985,7 @@ display_tight_png: function() { //Util.Debug(" ending RQ.length: " + RQ.length); //Util.Debug(" ending RQ.slice(0,20): " + RQ.slice(0,20)); //Util.Debug("<< display_tight_png"); + return true; }, extract_data_uri : function (arr) { @@ -1013,6 +1023,7 @@ set_desktopsize : function () { RFB.FBU.rects -= 1; Util.Debug("<< set_desktopsize"); + return true; }, set_cursor: function () { @@ -1042,6 +1053,7 @@ set_cursor: function () { RFB.FBU.rects -= 1; //Util.Debug("<< set_cursor"); + return true; }, set_jpeg_quality : function () { @@ -1238,16 +1250,15 @@ handle_message: function () { RFB.disconnect(); break; case 'normal': - RFB.normal_msg(); - /* - while (RFB.RQ.length > 0) { - if (RFB.normal_msg() && RFB.state === 'normal') { - Util.Debug("More to process"); + while ((RFB.state === 'normal') && (RFB.RQ.length > 0)) { + if (RFB.normal_msg()) { + // true means we can continue processing + Util.Debug("More data to process"); } else { + // false means we need more data break; } } - */ break; default: RFB.init_msg(); From b4748f041a104fa2e4fd97eab9d496d5a7d68fc7 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Fri, 23 Jul 2010 12:30:31 -0500 Subject: [PATCH 4/5] Add twitter link to follow @noVNC for commits/news. --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 1b35304..50d0268 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,10 @@ encryption, i.e. the "wss://" URI scheme. Special thanks to [Sentry Data Systems](http://www.sentryds.com) for sponsoring ongoing development of this project (and for employing me). +Notable commits, announcements and news are posted to +@noVNC + + ### Screenshots Running in Chrome before and after connecting: From acad10a5de417813880d0b52ceae9465d6a9eb9e Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Fri, 23 Jul 2010 12:32:15 -0500 Subject: [PATCH 5/5] README.md: correction about VNC_uri_prefix. It points to the include sub-directory, not to the directory above. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 50d0268..2f9d4e2 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,7 @@ See `vnc.html` and `vnc_auto.html` for examples. The file The `vnc.js` also includes other scripts within the `include` sub-directory. The `VNC_uri_prefix` variable can be use override the -URL path to the directory that contains the `include` sub-directory. +URL path to the `include` sub-directory. ### Troubleshooting