]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Add proper protocol encoder for XVP messages
authorPierre Ossman <ossman@cendio.se>
Fri, 13 Oct 2017 11:57:19 +0000 (13:57 +0200)
committerPierre Ossman <ossman@cendio.se>
Thu, 9 Nov 2017 11:45:08 +0000 (12:45 +0100)
core/rfb.js

index 3565f7cdfc43f1099d764bf2b957d0ea36c9fab6..18380e7e7dced4b70fd3cce857097ebc683dcaef 100644 (file)
@@ -285,7 +285,7 @@ RFB.prototype = {
     xvpOp: function (ver, op) {
         if (this._rfb_xvp_ver < ver) { return false; }
         Log.Info("Sending XVP operation " + op + " (version " + ver + ")");
-        this._sock.send_string("\xFA\x00" + String.fromCharCode(ver) + String.fromCharCode(op));
+        RFB.messages.xvpOp(this._sock, ver, op);
         return true;
     },
 
@@ -1850,7 +1850,21 @@ RFB.messages = {
 
         sock._sQlen += 10;
         sock.flush();
-    }
+    },
+
+    xvpOp: function (sock, ver, op) {
+        var buff = sock._sQ;
+        var offset = sock._sQlen;
+
+        buff[offset] = 250; // msg-type
+        buff[offset + 1] = 0; // padding
+
+        buff[offset + 2] = ver;
+        buff[offset + 3] = op;
+
+        sock._sQlen += 4;
+        sock.flush();
+    },
 };
 
 RFB.genDES = function (password, challenge) {