diff --git a/include/rfb.js b/include/rfb.js index fe92a778..fee6f271 100644 --- a/include/rfb.js +++ b/include/rfb.js @@ -1250,13 +1250,12 @@ handle_message: function () { RFB.disconnect(); break; case 'normal': - while ((RFB.state === 'normal') && (RFB.RQ.length > 0)) { + if ((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; + // Give other events a chance to run + setTimeout(RFB.handle_message, 10); } } break;