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
da0d1c86
Commit
da0d1c86
authored
Jan 18, 2017
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Decouple testing from the gunzip counter
Add a new counter, n_test_gunzip to track the former.
parent
13db0ab6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
15 deletions
+42
-15
cache_gzip.c
bin/varnishd/cache/cache_gzip.c
+25
-15
g00001.vtc
bin/varnishtest/tests/g00001.vtc
+4
-0
g00002.vtc
bin/varnishtest/tests/g00002.vtc
+4
-0
g00003.vtc
bin/varnishtest/tests/g00003.vtc
+4
-0
vsc_f_main.h
include/tbl/vsc_f_main.h
+5
-0
No files found.
bin/varnishd/cache/cache_gzip.c
View file @
da0d1c86
...
...
@@ -76,7 +76,7 @@ vgz_msg(const struct vgz *vg)
*/
static
struct
vgz
*
vgz_
alloc_vgz
(
struct
vsl_log
*
vsl
,
const
char
*
id
)
vgz_
gunzip
(
struct
vsl_log
*
vsl
,
const
char
*
id
)
{
struct
vgz
*
vg
;
...
...
@@ -84,17 +84,7 @@ vgz_alloc_vgz(struct vsl_log *vsl, const char *id)
AN
(
vg
);
vg
->
vsl
=
vsl
;
vg
->
id
=
id
;
return
(
vg
);
}
static
struct
vgz
*
VGZ_NewUngzip
(
struct
vsl_log
*
vsl
,
const
char
*
id
)
{
struct
vgz
*
vg
;
vg
=
vgz_alloc_vgz
(
vsl
,
id
);
vg
->
dir
=
VGZ_UN
;
VSC_C_main
->
n_gunzip
++
;
/*
* Max memory usage according to zonf.h:
...
...
@@ -106,15 +96,32 @@ VGZ_NewUngzip(struct vsl_log *vsl, const char *id)
return
(
vg
);
}
static
struct
vgz
*
VGZ_NewGunzip
(
struct
vsl_log
*
vsl
,
const
char
*
id
)
{
VSC_C_main
->
n_gunzip
++
;
return
(
vgz_gunzip
(
vsl
,
id
));
}
static
struct
vgz
*
VGZ_NewTestGunzip
(
struct
vsl_log
*
vsl
,
const
char
*
id
)
{
VSC_C_main
->
n_test_gunzip
++
;
return
(
vgz_gunzip
(
vsl
,
id
));
}
struct
vgz
*
VGZ_NewGzip
(
struct
vsl_log
*
vsl
,
const
char
*
id
)
{
struct
vgz
*
vg
;
int
i
;
vg
=
vgz_alloc_vgz
(
vsl
,
id
);
vg
->
dir
=
VGZ_GZ
;
VSC_C_main
->
n_gzip
++
;
ALLOC_OBJ
(
vg
,
VGZ_MAGIC
);
AN
(
vg
);
vg
->
vsl
=
vsl
;
vg
->
id
=
id
;
vg
->
dir
=
VGZ_GZ
;
/*
* From zconf.h:
...
...
@@ -293,7 +300,7 @@ VDP_gunzip(struct req *req, enum vdp_action act, void **priv,
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
if
(
act
==
VDP_INIT
)
{
vg
=
VGZ_New
Ung
zip
(
req
->
vsl
,
"U D -"
);
vg
=
VGZ_New
Gun
zip
(
req
->
vsl
,
"U D -"
);
AN
(
vg
);
if
(
vgz_getmbuf
(
vg
))
{
(
void
)
VGZ_Destroy
(
&
vg
);
...
...
@@ -451,7 +458,10 @@ vfp_gzip_init(struct vfp_ctx *vc, struct vfp_entry *vfe)
}
else
{
if
(
!
http_HdrIs
(
vc
->
http
,
H_Content_Encoding
,
"gzip"
))
return
(
VFP_NULL
);
vg
=
VGZ_NewUngzip
(
vc
->
wrk
->
vsl
,
vfe
->
vfp
->
priv1
);
if
(
vfe
->
vfp
->
priv2
==
VFP_GUNZIP
)
vg
=
VGZ_NewGunzip
(
vc
->
wrk
->
vsl
,
vfe
->
vfp
->
priv1
);
else
vg
=
VGZ_NewTestGunzip
(
vc
->
wrk
->
vsl
,
vfe
->
vfp
->
priv1
);
}
if
(
vg
==
NULL
)
return
(
VFP_ERROR
);
...
...
bin/varnishtest/tests/g00001.vtc
View file @
da0d1c86
...
...
@@ -43,3 +43,7 @@ client c1 {
expect resp.http.content-length == "26"
expect resp.http.content-encoding == "gzip"
} -run
varnish v1 -expect n_gzip == 0
varnish v1 -expect n_gunzip == 3
varnish v1 -expect n_test_gunzip == 1
bin/varnishtest/tests/g00002.vtc
View file @
da0d1c86
...
...
@@ -50,3 +50,7 @@ client c1 {
expect resp.http.content-encoding == <undef>
expect resp.bodylen == 4109
} -run
varnish v1 -expect n_gzip == 1
varnish v1 -expect n_gunzip == 3
varnish v1 -expect n_test_gunzip == 0
bin/varnishtest/tests/g00003.vtc
View file @
da0d1c86
...
...
@@ -49,3 +49,7 @@ client c1 {
expect resp.http.content-encoding == <undef>
expect resp.bodylen == 43
} -run
varnish v1 -expect n_gzip == 1
varnish v1 -expect n_gunzip == 2
varnish v1 -expect n_test_gunzip == 0
include/tbl/vsc_f_main.h
View file @
da0d1c86
...
...
@@ -662,6 +662,11 @@ VSC_FF(n_gunzip, uint64_t, 0, 'c', 'i', info,
""
)
VSC_FF
(
n_test_gunzip
,
uint64_t
,
0
,
'c'
,
'i'
,
info
,
"Test gunzip operations"
,
""
)
/*--------------------------------------------------------------------*/
VSC_FF
(
vsm_free
,
uint64_t
,
0
,
'g'
,
'B'
,
diag
,
...
...
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