Commit 29ad96c5 authored by Joel Martin's avatar Joel Martin

Give other events chance to fire.

After each complete framebufferUpdate, set a short timer to continue
processing the receive queue. This gives other events a chance to
fire. Especially important when noVNC is integrated into another
website.
parent a867de16
...@@ -1250,13 +1250,12 @@ handle_message: function () { ...@@ -1250,13 +1250,12 @@ handle_message: function () {
RFB.disconnect(); RFB.disconnect();
break; break;
case 'normal': case 'normal':
while ((RFB.state === 'normal') && (RFB.RQ.length > 0)) { if ((RFB.state === 'normal') && (RFB.RQ.length > 0)) {
if (RFB.normal_msg()) { if (RFB.normal_msg()) {
// true means we can continue processing // true means we can continue processing
Util.Debug("More data to process"); Util.Debug("More data to process");
} else { // Give other events a chance to run
// false means we need more data setTimeout(RFB.handle_message, 10);
break;
} }
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment