Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
86105f69
Commit
86105f69
authored
Nov 16, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update libvgz and neuter the adler32 bits we do not use.
parent
5d48d91e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
11 deletions
+53
-11
adler32.c
lib/libvgz/adler32.c
+13
-0
deflate.c
lib/libvgz/deflate.c
+3
-3
trees.c
lib/libvgz/trees.c
+3
-3
vgz.h
lib/libvgz/vgz.h
+6
-5
cmp_libz.sh
tools/cmp_libz.sh
+28
-0
No files found.
lib/libvgz/adler32.c
View file @
86105f69
...
...
@@ -7,6 +7,7 @@
#include "zutil.h"
#ifdef NOVGZ
local
uLong
adler32_combine_
OF
((
uLong
adler1
,
uLong
adler2
,
z_off64_t
len2
));
#define BASE 65521U
/* largest prime smaller than 65536 */
...
...
@@ -184,3 +185,15 @@ uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
{
return
adler32_combine_
(
adler1
,
adler2
,
len2
);
}
#else
uLong
ZEXPORT
adler32
(
adler
,
buf
,
len
)
uLong
adler
;
const
Bytef
*
buf
;
uInt
len
;
{
(
void
)
adler
;
(
void
)
buf
;
(
void
)
len
;
abort
();
}
#endif
lib/libvgz/deflate.c
View file @
86105f69
...
...
@@ -511,7 +511,7 @@ int ZEXPORT deflateResetKeep (strm)
s
->
wrap
==
2
?
crc32
(
0L
,
Z_NULL
,
0
)
:
#endif
adler32
(
0L
,
Z_NULL
,
0
);
s
->
last_flush
=
Z_NO_FLUSH
;
s
->
last_flush
=
-
2
;
_tr_init
(
s
);
...
...
@@ -606,12 +606,12 @@ int ZEXPORT deflateParams(strm, level, strategy)
func
=
configuration_table
[
s
->
level
].
func
;
if
((
strategy
!=
s
->
strategy
||
func
!=
configuration_table
[
level
].
func
)
&&
s
->
high_water
)
{
s
->
last_flush
!=
-
2
)
{
/* Flush the last buffer: */
int
err
=
deflate
(
strm
,
Z_BLOCK
);
if
(
err
==
Z_STREAM_ERROR
)
return
err
;
if
(
strm
->
avail_
out
==
0
)
if
(
strm
->
avail_
in
||
(
s
->
strstart
-
s
->
block_start
)
+
s
->
lookahead
)
return
Z_BUF_ERROR
;
}
if
(
s
->
level
!=
level
)
{
...
...
lib/libvgz/trees.c
View file @
86105f69
...
...
@@ -122,13 +122,13 @@ struct static_tree_desc_s {
int
max_length
;
/* max bit length for the codes */
};
local
static_tree_desc
static_l_desc
=
local
const
static_tree_desc
static_l_desc
=
{
static_ltree
,
extra_lbits
,
LITERALS
+
1
,
L_CODES
,
MAX_BITS
};
local
static_tree_desc
static_d_desc
=
local
const
static_tree_desc
static_d_desc
=
{
static_dtree
,
extra_dbits
,
0
,
D_CODES
,
MAX_BITS
};
local
static_tree_desc
static_bl_desc
=
local
const
static_tree_desc
static_bl_desc
=
{(
const
ct_data
*
)
0
,
extra_blbits
,
0
,
BL_CODES
,
MAX_BL_BITS
};
/* ===========================================================================
...
...
lib/libvgz/vgz.h
View file @
86105f69
...
...
@@ -716,11 +716,12 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
used to switch between compression and straight copy of the input data, or
to switch to a different kind of input data requiring a different strategy.
If the compression approach (which is a function of the level) or the
strategy is changed, and if any input has been consumed in a previous
deflate() call, then the input available so far is compressed with the old
level and strategy using deflate(strm, Z_BLOCK). There are three approaches
for the compression levels 0, 1..3, and 4..9 respectively. The new level
and strategy will take effect at the next call of deflate().
strategy is changed, and if there have been any deflate() calls since the
state was initialized or reset, then the input available so far is
compressed with the old level and strategy using deflate(strm, Z_BLOCK).
There are three approaches for the compression levels 0, 1..3, and 4..9
respectively. The new level and strategy will take effect at the next call
of deflate().
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
not have enough output space to complete, then the parameter change will not
...
...
tools/cmp_libz.sh
0 → 100644
View file @
86105f69
#!/bin/sh
# This script compares libvgz to zlib in FreeBSD source tree
LZ
=
/usr/src/contrib/zlib
if
[
!
-d
lib/libvgz
]
;
then
echo
"Run this from to of tree"
1>&2
exit
2
fi
for
i
in
lib/libvgz/
*
.[ch]
do
b
=
`
basename
$i
`
if
[
"
$b
"
==
"vgz.h"
]
;
then
b
=
"zlib.h"
fi
if
[
-f
${
LZ
}
/
$b
]
;
then
echo
"====
$b
"
sed
'
s/vgz.h/zlib.h/
/strm->msg =/s/"/(char *)"/
'
$i
|
diff
-u
${
LZ
}
/
$b
-
else
echo
"####
$b
#### NOT FOUND ####"
fi
done
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