Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishevent3
Project
Project
Details
Activity
Releases
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
uplex-varnish
varnishevent3
Commits
e2a3fcc6
Commit
e2a3fcc6
authored
Jan 31, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Emit a "Gzip" VSL record on each gzip operation.
Remember to free vgz structures again in ESI fetching
parent
e1a2c7fe
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
25 deletions
+44
-25
cache.h
bin/varnishd/cache.h
+2
-2
cache_center.c
bin/varnishd/cache_center.c
+1
-2
cache_esi_deliver.c
bin/varnishd/cache_esi_deliver.c
+1
-1
cache_esi_fetch.c
bin/varnishd/cache_esi_fetch.c
+9
-6
cache_gzip.c
bin/varnishd/cache_gzip.c
+28
-13
cache_response.c
bin/varnishd/cache_response.c
+1
-1
vsl_tags.h
include/vsl_tags.h
+2
-0
No files found.
bin/varnishd/cache.h
View file @
e2a3fcc6
...
...
@@ -638,8 +638,8 @@ void Fetch_Init(void);
struct
vgz
;
enum
vgz_flag
{
VGZ_NORMAL
,
VGZ_ALIGN
,
VGZ_RESET
,
VGZ_FINISH
};
struct
vgz
*
VGZ_NewUngzip
(
struct
sess
*
sp
);
struct
vgz
*
VGZ_NewGzip
(
struct
sess
*
sp
);
struct
vgz
*
VGZ_NewUngzip
(
struct
sess
*
sp
,
const
char
*
id
);
struct
vgz
*
VGZ_NewGzip
(
struct
sess
*
sp
,
const
char
*
id
);
void
VGZ_Ibuf
(
struct
vgz
*
,
const
void
*
,
ssize_t
len
);
int
VGZ_IbufEmpty
(
const
struct
vgz
*
vg
);
void
VGZ_Obuf
(
struct
vgz
*
,
const
void
*
,
ssize_t
len
);
...
...
bin/varnishd/cache_center.c
View file @
e2a3fcc6
...
...
@@ -431,8 +431,7 @@ cnt_error(struct sess *sp)
}
/*--------------------------------------------------------------------
* We have fetched the headers from the backend, ask the VCL code what
* to do next, then head off in that direction.
* Fetch an object from the backend, either for pass or for caching.
*
DOT subgraph xcluster_fetch {
DOT fetch [
...
...
bin/varnishd/cache_esi_deliver.c
View file @
e2a3fcc6
...
...
@@ -274,7 +274,7 @@ ESI_Deliver(struct sess *sp)
}
if
(
isgzip
&&
!
sp
->
wrk
->
gzip_resp
)
{
vgz
=
VGZ_NewUngzip
(
sp
);
vgz
=
VGZ_NewUngzip
(
sp
,
"U D E"
);
obufl
=
0
;
}
...
...
bin/varnishd/cache_esi_fetch.c
View file @
e2a3fcc6
...
...
@@ -305,24 +305,24 @@ vfp_esi_begin(struct sess *sp, size_t estimate)
/* XXX: snapshot WS's ? We'll need the space */
if
(
sp
->
wrk
->
is_gzip
&&
sp
->
wrk
->
do_gunzip
)
{
sp
->
wrk
->
vgz_rx
=
VGZ_NewUngzip
(
sp
);
sp
->
wrk
->
vgz_rx
=
VGZ_NewUngzip
(
sp
,
"U F E"
);
VEP_Init
(
sp
,
NULL
);
}
else
if
(
sp
->
wrk
->
is_gunzip
&&
sp
->
wrk
->
do_gzip
)
{
vef
=
(
void
*
)
WS_Alloc
(
sp
->
ws
,
sizeof
*
vef
);
AN
(
vef
);
memset
(
vef
,
0
,
sizeof
*
vef
);
vef
->
magic
=
VEF_MAGIC
;
vef
->
vgz
=
VGZ_NewGzip
(
sp
);
vef
->
vgz
=
VGZ_NewGzip
(
sp
,
"G F E"
);
AZ
(
sp
->
wrk
->
vef_priv
);
sp
->
wrk
->
vef_priv
=
vef
;
VEP_Init
(
sp
,
vfp_vep_callback
);
}
else
if
(
sp
->
wrk
->
is_gzip
)
{
sp
->
wrk
->
vgz_rx
=
VGZ_NewUngzip
(
sp
);
sp
->
wrk
->
vgz_rx
=
VGZ_NewUngzip
(
sp
,
"U F E"
);
vef
=
(
void
*
)
WS_Alloc
(
sp
->
ws
,
sizeof
*
vef
);
AN
(
vef
);
memset
(
vef
,
0
,
sizeof
*
vef
);
vef
->
magic
=
VEF_MAGIC
;
vef
->
vgz
=
VGZ_NewGzip
(
sp
);
vef
->
vgz
=
VGZ_NewGzip
(
sp
,
"G F E"
);
AZ
(
sp
->
wrk
->
vef_priv
);
sp
->
wrk
->
vef_priv
=
vef
;
VEP_Init
(
sp
,
vfp_vep_callback
);
...
...
@@ -373,12 +373,15 @@ vfp_esi_end(struct sess *sp)
sp
->
obj
->
esidata
->
len
=
l
;
vsb_delete
(
vsb
);
}
if
(
sp
->
wrk
->
vgz_rx
!=
NULL
)
VGZ_Destroy
(
&
sp
->
wrk
->
vgz_rx
);
if
(
sp
->
wrk
->
vef_priv
!=
NULL
)
{
vef
=
sp
->
wrk
->
vef_priv
;
VGZ_UpdateObj
(
vef
->
vgz
,
sp
->
obj
);
sp
->
wrk
->
vef_priv
=
NULL
;
CHECK_OBJ_NOTNULL
(
vef
,
VEF_MAGIC
);
sp
->
wrk
->
vef_priv
=
NULL
;
VGZ_UpdateObj
(
vef
->
vgz
,
sp
->
obj
);
VGZ_Destroy
(
&
vef
->
vgz
);
XXXAZ
(
vef
->
error
);
sp
->
obj
->
gziped
=
1
;
}
else
{
...
...
bin/varnishd/cache_gzip.c
View file @
e2a3fcc6
...
...
@@ -71,6 +71,7 @@
#include "svnid.h"
SVNID
(
"$Id$"
)
#include "vsl.h"
#include "cache.h"
#include "stevedore.h"
...
...
@@ -79,6 +80,8 @@ SVNID("$Id$")
struct
vgz
{
unsigned
magic
;
#define VGZ_MAGIC 0x162df0cb
struct
sess
*
sess
;
const
char
*
id
;
struct
ws
*
tmp
;
char
*
tmp_snapshot
;
...
...
@@ -113,7 +116,7 @@ vgz_free(voidpf opaque, voidpf address)
*/
static
struct
vgz
*
vgz_alloc_vgz
(
struct
sess
*
sp
)
vgz_alloc_vgz
(
struct
sess
*
sp
,
const
char
*
id
)
{
struct
vgz
*
vg
;
struct
ws
*
ws
=
sp
->
wrk
->
ws
;
...
...
@@ -123,6 +126,8 @@ vgz_alloc_vgz(struct sess *sp)
AN
(
vg
);
memset
(
vg
,
0
,
sizeof
*
vg
);
vg
->
magic
=
VGZ_MAGIC
;
vg
->
sess
=
sp
;
vg
->
id
=
id
;
switch
(
params
->
gzip_tmp_space
)
{
case
0
:
...
...
@@ -149,12 +154,12 @@ vgz_alloc_vgz(struct sess *sp)
}
struct
vgz
*
VGZ_NewUngzip
(
struct
sess
*
sp
)
VGZ_NewUngzip
(
struct
sess
*
sp
,
const
char
*
id
)
{
struct
vgz
*
vg
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
vg
=
vgz_alloc_vgz
(
sp
);
vg
=
vgz_alloc_vgz
(
sp
,
id
);
/*
* Max memory usage according to zonf.h:
...
...
@@ -167,13 +172,13 @@ VGZ_NewUngzip(struct sess *sp)
}
struct
vgz
*
VGZ_NewGzip
(
struct
sess
*
sp
)
VGZ_NewGzip
(
struct
sess
*
sp
,
const
char
*
id
)
{
struct
vgz
*
vg
;
int
i
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
vg
=
vgz_alloc_vgz
(
sp
);
vg
=
vgz_alloc_vgz
(
sp
,
id
);
/*
* From zconf.h:
...
...
@@ -353,13 +358,23 @@ VGZ_UpdateObj(const struct vgz *vg, struct object *obj)
/*--------------------------------------------------------------------*/
void
VGZ_Destroy
(
struct
vgz
**
vg
)
VGZ_Destroy
(
struct
vgz
**
vg
p
)
{
struct
vgz
*
vg
;
CHECK_OBJ_NOTNULL
(
*
vg
,
VGZ_MAGIC
);
if
((
*
vg
)
->
tmp
!=
NULL
)
WS_Reset
((
*
vg
)
->
tmp
,
(
*
vg
)
->
tmp_snapshot
);
*
vg
=
NULL
;
vg
=
*
vgp
;
CHECK_OBJ_NOTNULL
(
vg
,
VGZ_MAGIC
);
*
vgp
=
NULL
;
WSP
(
vg
->
sess
,
SLT_Gzip
,
"%s %jd %jd %jd %jd %jd"
,
vg
->
id
,
(
intmax_t
)
vg
->
vz
.
total_in
,
(
intmax_t
)
vg
->
vz
.
total_out
,
(
intmax_t
)
vg
->
vz
.
start_bit
,
(
intmax_t
)
vg
->
vz
.
last_bit
,
(
intmax_t
)
vg
->
vz
.
stop_bit
);
if
(
vg
->
tmp
!=
NULL
)
WS_Reset
(
vg
->
tmp
,
vg
->
tmp_snapshot
);
}
/*--------------------------------------------------------------------
...
...
@@ -372,7 +387,7 @@ static void __match_proto__()
vfp_gunzip_begin
(
struct
sess
*
sp
,
size_t
estimate
)
{
(
void
)
estimate
;
sp
->
wrk
->
vgz_rx
=
VGZ_NewUngzip
(
sp
);
sp
->
wrk
->
vgz_rx
=
VGZ_NewUngzip
(
sp
,
"U F -"
);
}
static
int
__match_proto__
()
...
...
@@ -441,7 +456,7 @@ vfp_gzip_begin(struct sess *sp, size_t estimate)
{
(
void
)
estimate
;
sp
->
wrk
->
vgz_rx
=
VGZ_NewGzip
(
sp
);
sp
->
wrk
->
vgz_rx
=
VGZ_NewGzip
(
sp
,
"G F -"
);
}
static
int
__match_proto__
()
...
...
@@ -517,7 +532,7 @@ static void __match_proto__()
vfp_testgzip_begin
(
struct
sess
*
sp
,
size_t
estimate
)
{
(
void
)
estimate
;
sp
->
wrk
->
vgz_rx
=
VGZ_NewUngzip
(
sp
);
sp
->
wrk
->
vgz_rx
=
VGZ_NewUngzip
(
sp
,
"u F -"
);
}
static
int
__match_proto__
()
...
...
bin/varnishd/cache_response.c
View file @
e2a3fcc6
...
...
@@ -253,7 +253,7 @@ res_WriteGunzipObj(struct sess *sp)
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
vg
=
VGZ_NewUngzip
(
sp
);
vg
=
VGZ_NewUngzip
(
sp
,
"U R -"
);
VTAILQ_FOREACH
(
st
,
&
sp
->
obj
->
store
,
list
)
{
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
...
...
include/vsl_tags.h
View file @
e2a3fcc6
...
...
@@ -98,3 +98,5 @@ SLTM(Hash)
SLTM
(
Backend_health
)
SLTM
(
VCL_Log
)
SLTM
(
Gzip
)
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