Update websock.js from noVNC
Sync with noVNC as of commit ae510306b5094b55aa08a2a0d15a151704f70993. The main change is to make it a more proper object that you can instantiate multiple times.
This commit is contained in:
+7
-5
@@ -91,8 +91,8 @@
|
||||
now = (new Date()).getTime(); // Early as possible
|
||||
|
||||
arr = ws.rQshiftBytes(ws.rQlen());
|
||||
first = String.fromCharCode(arr.shift());
|
||||
last = String.fromCharCode(arr.pop());
|
||||
first = String.fromCharCode(arr[0]);
|
||||
last = String.fromCharCode(arr[arr.length-1]);
|
||||
|
||||
if (first != "^") {
|
||||
message("Error: packet missing start char '^'");
|
||||
@@ -104,9 +104,11 @@
|
||||
disconnect();
|
||||
return;
|
||||
}
|
||||
arr = arr.map(function(num) {
|
||||
return String.fromCharCode(num);
|
||||
} ).join('').split(':');
|
||||
text = ''
|
||||
for (var i = 1; i < arr.length-1; i++) {
|
||||
text += String.fromCharCode(arr[i]);
|
||||
}
|
||||
arr = text.split(':');
|
||||
seq = arr[0];
|
||||
timestamp = parseInt(arr[1],10);
|
||||
rpayload = arr[2];
|
||||
|
||||
Reference in New Issue
Block a user