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
bbb4514a
Commit
bbb4514a
authored
Sep 24, 2018
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mark our extension to ZLib and #ifdef the code in varnishtest which
reports stuff from it for debugging.
parent
ab648c84
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
vtc_http.c
bin/varnishtest/vtc_http.c
+5
-1
vgz.h
lib/libvgz/vgz.h
+1
-0
No files found.
bin/varnishtest/vtc_http.c
View file @
bbb4514a
...
@@ -771,6 +771,7 @@ cmd_http_gunzip(CMD_ARGS)
...
@@ -771,6 +771,7 @@ cmd_http_gunzip(CMD_ARGS)
vtc_log
(
hp
->
vl
,
3
,
"new bodylen %u"
,
hp
->
bodyl
);
vtc_log
(
hp
->
vl
,
3
,
"new bodylen %u"
,
hp
->
bodyl
);
vtc_dump
(
hp
->
vl
,
4
,
"body"
,
hp
->
body
,
hp
->
bodyl
);
vtc_dump
(
hp
->
vl
,
4
,
"body"
,
hp
->
body
,
hp
->
bodyl
);
bprintf
(
hp
->
bodylen
,
"%u"
,
hp
->
bodyl
);
bprintf
(
hp
->
bodylen
,
"%u"
,
hp
->
bodyl
);
#ifdef VGZ_EXTENSIONS
vtc_log
(
hp
->
vl
,
4
,
"startbit = %ju %ju/%ju"
,
vtc_log
(
hp
->
vl
,
4
,
"startbit = %ju %ju/%ju"
,
(
uintmax_t
)
vz
.
start_bit
,
(
uintmax_t
)
vz
.
start_bit
,
(
uintmax_t
)
vz
.
start_bit
>>
3
,
(
uintmax_t
)
vz
.
start_bit
&
7
);
(
uintmax_t
)
vz
.
start_bit
>>
3
,
(
uintmax_t
)
vz
.
start_bit
&
7
);
...
@@ -780,6 +781,7 @@ cmd_http_gunzip(CMD_ARGS)
...
@@ -780,6 +781,7 @@ cmd_http_gunzip(CMD_ARGS)
vtc_log
(
hp
->
vl
,
4
,
"stopbit = %ju %ju/%ju"
,
vtc_log
(
hp
->
vl
,
4
,
"stopbit = %ju %ju/%ju"
,
(
uintmax_t
)
vz
.
stop_bit
,
(
uintmax_t
)
vz
.
stop_bit
,
(
uintmax_t
)
vz
.
stop_bit
>>
3
,
(
uintmax_t
)
vz
.
stop_bit
&
7
);
(
uintmax_t
)
vz
.
stop_bit
>>
3
,
(
uintmax_t
)
vz
.
stop_bit
&
7
);
#endif
if
(
i
!=
Z_STREAM_END
)
if
(
i
!=
Z_STREAM_END
)
vtc_log
(
hp
->
vl
,
hp
->
fatal
,
vtc_log
(
hp
->
vl
,
hp
->
fatal
,
"Gunzip error = %d (%s) in:%jd out:%jd"
,
"Gunzip error = %d (%s) in:%jd out:%jd"
,
...
@@ -813,12 +815,13 @@ gzip_body(const struct http *hp, const char *txt, char **body, int *bodylen)
...
@@ -813,12 +815,13 @@ gzip_body(const struct http *hp, const char *txt, char **body, int *bodylen)
assert
(
Z_OK
==
deflateInit2
(
&
vz
,
assert
(
Z_OK
==
deflateInit2
(
&
vz
,
hp
->
gziplevel
,
Z_DEFLATED
,
31
,
9
,
Z_DEFAULT_STRATEGY
));
hp
->
gziplevel
,
Z_DEFLATED
,
31
,
9
,
Z_DEFAULT_STRATEGY
));
assert
(
Z_STREAM_END
==
deflate
(
&
vz
,
Z_FINISH
));
assert
(
Z_STREAM_END
==
deflate
(
&
vz
,
Z_FINISH
));
*
bodylen
=
vz
.
total_out
;
#ifdef VGZ_EXTENSIONS
i
=
vz
.
stop_bit
&
7
;
i
=
vz
.
stop_bit
&
7
;
if
(
hp
->
gzipresidual
>=
0
&&
hp
->
gzipresidual
!=
i
)
if
(
hp
->
gzipresidual
>=
0
&&
hp
->
gzipresidual
!=
i
)
vtc_log
(
hp
->
vl
,
hp
->
fatal
,
vtc_log
(
hp
->
vl
,
hp
->
fatal
,
"Wrong gzip residual got %d wanted %d"
,
"Wrong gzip residual got %d wanted %d"
,
i
,
hp
->
gzipresidual
);
i
,
hp
->
gzipresidual
);
*
bodylen
=
vz
.
total_out
;
vtc_log
(
hp
->
vl
,
4
,
"startbit = %ju %ju/%ju"
,
vtc_log
(
hp
->
vl
,
4
,
"startbit = %ju %ju/%ju"
,
(
uintmax_t
)
vz
.
start_bit
,
(
uintmax_t
)
vz
.
start_bit
,
(
uintmax_t
)
vz
.
start_bit
>>
3
,
(
uintmax_t
)
vz
.
start_bit
&
7
);
(
uintmax_t
)
vz
.
start_bit
>>
3
,
(
uintmax_t
)
vz
.
start_bit
&
7
);
...
@@ -829,6 +832,7 @@ gzip_body(const struct http *hp, const char *txt, char **body, int *bodylen)
...
@@ -829,6 +832,7 @@ gzip_body(const struct http *hp, const char *txt, char **body, int *bodylen)
(
uintmax_t
)
vz
.
stop_bit
,
(
uintmax_t
)
vz
.
stop_bit
,
(
uintmax_t
)
vz
.
stop_bit
>>
3
,
(
uintmax_t
)
vz
.
stop_bit
&
7
);
(
uintmax_t
)
vz
.
stop_bit
>>
3
,
(
uintmax_t
)
vz
.
stop_bit
&
7
);
assert
(
Z_OK
==
deflateEnd
(
&
vz
));
assert
(
Z_OK
==
deflateEnd
(
&
vz
));
#endif
}
}
/**********************************************************************
/**********************************************************************
...
...
lib/libvgz/vgz.h
View file @
bbb4514a
...
@@ -104,6 +104,7 @@ typedef struct z_stream_s {
...
@@ -104,6 +104,7 @@ typedef struct z_stream_s {
uLong
adler
;
/* Adler-32 or CRC-32 value of the uncompressed data */
uLong
adler
;
/* Adler-32 or CRC-32 value of the uncompressed data */
uLong
reserved
;
/* reserved for future use */
uLong
reserved
;
/* reserved for future use */
#define VGZ_EXTENSIONS 1
uLong
start_bit
;
/* Bit pos of first deflate block */
uLong
start_bit
;
/* Bit pos of first deflate block */
uLong
stop_bit
;
/* Bit pos after last deflate block */
uLong
stop_bit
;
/* Bit pos after last deflate block */
uLong
last_bit
;
/* Bit pos of 'last' bit */
uLong
last_bit
;
/* Bit pos of 'last' bit */
...
...
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