summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsamhed <samuel@cendio.se>2016-06-02 14:57:44 +0200
committersamhed <samuel@cendio.se>2016-06-03 10:55:42 +0200
commit3af1a3a05b8d251faaa552c8dee2b3294fc9d357 (patch)
tree5d9b51c3d617a5861ce9b6fd2ed1e2a8da13ac79
parent5a20f425d4fddf67aef14c25ccea7d3fc2315677 (diff)
downloadnovnc-3af1a3a05b8d251faaa552c8dee2b3294fc9d357.tar.gz
Avoid unnecessary delays
We only use setTimeout() to avoid hanging the browser, not because we actually want a delay. So let's use the smallest delay there is.
-rw-r--r--include/rfb.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/rfb.js b/include/rfb.js
index f426c15..fa2401d 100644
--- a/include/rfb.js
+++ b/include/rfb.js
@@ -255,7 +255,7 @@ var RFB;
sendPassword: function (passwd) {
this._rfb_password = passwd;
this._rfb_state = 'Authentication';
- setTimeout(this._init_msg.bind(this), 1);
+ setTimeout(this._init_msg.bind(this), 0);
},
sendCtrlAltDel: function () {
@@ -549,7 +549,7 @@ var RFB;
this._msgTimer = setTimeout(function () {
this._msgTimer = null;
this._handle_message();
- }.bind(this), 10);
+ }.bind(this), 0);
} else {
Util.Debug("More data to process, existing timer");
}