Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
noVNC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
noVNC
Commits
8acfc8cf
Commit
8acfc8cf
authored
May 16, 2010
by
Joel Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change wstest.html 'cnt' to 'seq'.
parent
f9583f1f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
wstest.html
wstest.html
+10
-10
No files found.
wstest.html
View file @
8acfc8cf
...
...
@@ -54,7 +54,7 @@
var
ws
=
null
,
update_ref
=
null
,
send_ref
=
null
;
var
sent
=
0
,
received
=
0
,
errors
=
0
;
var
max_send
=
2000
;
var
recv_
cnt
=
0
,
send_cnt
=
0
;
var
recv_
seq
=
0
,
send_seq
=
0
;
Array
.
prototype
.
pushStr
=
function
(
str
)
{
var
n
=
str
.
length
;
...
...
@@ -89,19 +89,19 @@
arr
=
decoded
.
map
(
function
(
num
)
{
return
String
.
fromCharCode
(
num
);
}
).
join
(
''
).
split
(
':'
);
cnt
=
arr
[
0
];
seq
=
arr
[
0
];
length
=
arr
[
1
];
chksum
=
arr
[
2
];
nums
=
arr
[
3
];
//console.log(" length:" + length + " chksum:" + chksum + " nums:" + nums);
if
(
cnt
!=
recv_cnt
)
{
if
(
seq
!=
recv_seq
)
{
errors
++
;
error
(
"Expected
count "
+
recv_cnt
+
" but got "
+
cnt
);
recv_
cnt
=
parseInt
(
cnt
,
10
)
+
1
;
// Back on track
error
(
"Expected
seq "
+
recv_seq
+
" but got "
+
seq
);
recv_
seq
=
parseInt
(
seq
,
10
)
+
1
;
// Back on track
return
;
}
recv_
cnt
++
;
recv_
seq
++
;
if
(
nums
.
length
!=
length
)
{
errors
++
;
error
(
"Expected length "
+
length
+
" but got "
+
nums
.
length
);
...
...
@@ -138,8 +138,8 @@
chksum += parseInt(numlist[i], 10);
}
var nums = numlist.join('');
arr.pushStr("
^
" + send_
cnt
+ "
:
" + length + "
:
" + chksum + "
:
" + nums + "
$
")
send_
cnt
++;
arr.pushStr("
^
" + send_
seq
+ "
:
" + length + "
:
" + chksum + "
:
" + nums + "
$
")
send_
seq
++;
ws.send(Base64.encode(arr));
sent++;
}
...
...
@@ -216,8 +216,8 @@
$clear(update_ref);
update_stats(); // Final numbers
recv_
cnt
= 0;
send_
cnt
= 0;
recv_
seq
= 0;
send_
seq
= 0;
$('connectButton').value = "
Start
";
$('connectButton').onclick = connect;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment