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
6fbc3748
Commit
6fbc3748
authored
Jan 28, 2012
by
Mike Tinglof
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix handling of min compression size
parent
b0ac240f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
5 deletions
+23
-5
rfb.js
include/rfb.js
+23
-5
No files found.
include/rfb.js
View file @
6fbc3748
...
...
@@ -309,6 +309,7 @@ init_vars = function() {
}
for
(
i
=
0
;
i
<
4
;
i
++
)
{
//FBU.zlibs[i] = new InflateStream();
FBU
.
zlibs
[
i
]
=
new
TINF
();
FBU
.
zlibs
[
i
].
init
();
}
...
...
@@ -1302,10 +1303,21 @@ encHandlers.TIGHT = function display_tight() {
var
decompress
=
function
(
data
)
{
// TODO: process resetStreams here
var
uncompressed
=
FBU
.
zlibs
[
streamId
].
uncompress
(
data
,
0
);
if
(
uncompressed
.
status
!=
0
)
if
(
uncompressed
.
status
!=
=
0
)
throw
(
"Invalid data in zlib stream"
);
Util
.
Warn
(
"Decompressed "
+
data
.
length
+
" to "
+
uncompressed
.
data
.
length
+
" checksums "
+
checksum
(
data
)
+
":"
+
checksum
(
uncompressed
.
data
));
/*
var i;
var uncompressed2 = zip_inflate(data);
for (i=0;i<uncompressed.length;i++)
if (uncompressed[i] !== uncompressed2[i]) {
Util.Warn("Decompression difference at " + i);
break;
}
*/
return
uncompressed
.
data
;
}
...
...
@@ -1320,8 +1332,11 @@ encHandlers.TIGHT = function display_tight() {
var
bpp
=
(
numColors
<=
2
)
?
1
:
8
;
var
rowSize
=
Math
.
floor
((
FBU
.
width
*
bpp
+
7
)
/
8
);
if
(
rowSize
*
FBU
.
height
<
12
)
var
raw
=
false
;
if
(
rowSize
*
FBU
.
height
<
12
)
{
raw
=
true
;
clength
=
[
0
,
rowSize
*
FBU
.
height
];
}
else
clength
=
getCLength
(
ws
.
rQslice
(
3
+
paletteSize
,
3
+
paletteSize
+
3
));
FBU
.
bytes
+=
clength
[
0
]
+
clength
[
1
];
...
...
@@ -1333,7 +1348,7 @@ encHandlers.TIGHT = function display_tight() {
if
(
streamId
==
0
)
throw
(
"Wrong stream"
);
// Process data
if
(
clength
[
1
]
<
12
)
if
(
raw
)
data
=
ws
.
rQshiftBytes
(
clength
[
1
]);
else
data
=
decompress
(
ws
.
rQshiftBytes
(
clength
[
1
]));
...
...
@@ -1342,9 +1357,12 @@ encHandlers.TIGHT = function display_tight() {
}
var
handleCopy
=
function
()
{
var
raw
=
false
;
var
uncompressedSize
=
FBU
.
width
*
FBU
.
height
*
fb_depth
;
if
(
uncompressedSize
<
12
)
if
(
uncompressedSize
<
12
)
{
raw
=
true
;
clength
=
[
0
,
uncompressedSize
];
}
else
clength
=
getCLength
(
ws
.
rQslice
(
1
,
4
));
FBU
.
bytes
=
1
+
clength
[
0
]
+
clength
[
1
];
// ctl + clength size + zlib-data
...
...
@@ -1353,7 +1371,7 @@ encHandlers.TIGHT = function display_tight() {
if
(
streamId
!=
0
)
throw
(
"Wrong stream"
);
ws
.
rQshiftBytes
(
1
+
clength
[
0
]);
// ctl + clength
if
(
clength
[
1
]
<
12
)
if
(
raw
)
data
=
ws
.
rQshiftBytes
(
clength
[
1
]);
else
data
=
decompress
(
ws
.
rQshiftBytes
(
clength
[
1
]));
...
...
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