Skip to content

Commit

Permalink
show that we're waiting for the decode worker
Browse files Browse the repository at this point in the history
and it doesn't answer in time, continue without it
  • Loading branch information
totaam committed Dec 27, 2021
1 parent 5e2c2fa commit 96b94ea
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions html5/js/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ XpraClient.prototype.open_protocol = function() {
uri += this.path;
// do open
this.uri = uri;
this.on_connection_progress("Opening WebSocket connection", uri, 60);
this.on_connection_progress("Opening WebSocket connection", uri, 50);
this.protocol.open(uri);
};

Expand Down Expand Up @@ -1068,12 +1068,22 @@ XpraClient.prototype.emit_connection_established = function(event_type) {
/**
* Hello
*/
XpraClient.prototype._send_hello = function() {
XpraClient.prototype._send_hello = function(counter) {
if (this.decode_worker==null) {
this.clog("waiting for decode worker to finish initializing");
counter = (counter || 0);
if (counter==0) {
this.on_connection_progress("Waiting for decode worker", "", 90);
this.clog("waiting for decode worker to finish initializing");
}
else if (counter>100) {
//we have waited 10 seconds or more...
//continue without:
this.do_send_hello(null, null);
}
//try again later:
const me = this;
setTimeout(function() {
me._send_hello();
me._send_hello(counter+1);
}, 100);
}
else {
Expand Down

0 comments on commit 96b94ea

Please sign in to comment.