rfb.js/tight_png: fix indexed receive queue handling.

getCLength was not using the index (RQi) into the receive queue.
This commit is contained in:
Joel Martin 2010-08-27 11:21:30 -05:00
parent 4ff85f496c
commit eabf4670fb
1 changed files with 4 additions and 7 deletions

View File

@ -1348,9 +1348,7 @@ encHandlers.TIGHT_PNG = function display_tight_png() {
//Util.Debug(">> display_tight_png");
var ctl, cmode, clength, getCLength, color, img;
//Util.Debug(" FBU.rects: " + FBU.rects);
//Util.Debug(" RQlen(): " + RQlen());
//Util.Debug(" RQ.slice(0,20): " + RQ.slice(0,20));
//Util.Debug(" starting RQ.slice(RQi,RQi+20): " + RQ.slice(RQi,RQi+20) + " (" + RQlen() + ")");
FBU.bytes = 1; // compression-control byte
if (RQlen() < FBU.bytes) {
@ -1398,13 +1396,13 @@ encHandlers.TIGHT_PNG = function display_tight_png() {
// Determine FBU.bytes
switch (cmode) {
case "fill":
RQ[RQi++]; // shift off ctl
RQi++; // shift off ctl
color = RQshiftBytes(fb_depth);
canvas.fillRect(FBU.x, FBU.y, FBU.width, FBU.height, color);
break;
case "jpeg":
case "png":
clength = getCLength(RQ, 1);
clength = getCLength(RQ, RQi+1);
FBU.bytes = 1 + clength[0] + clength[1]; // ctl + clength size + jpeg-data
if (RQlen() < FBU.bytes) {
Util.Debug(" waiting for TIGHT " + cmode + " bytes");
@ -1424,8 +1422,7 @@ encHandlers.TIGHT_PNG = function display_tight_png() {
}
FBU.bytes = 0;
FBU.rects -= 1;
//Util.Debug(" ending RQlen(): " + RQlen());
//Util.Debug(" ending RQ.slice(0,20): " + RQ.slice(0,20));
//Util.Debug(" ending RQ.slice(RQi,RQi+20): " + RQ.slice(RQi,RQi+20) + " (" + RQlen() + ")");
//Util.Debug("<< display_tight_png");
return true;
};