Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
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
unique-xids
Commits
5e673e14
Commit
5e673e14
authored
Oct 24, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start to push struct sess out of the "fetch non-esi body from backend"
code path, to pave the road for Martins streaming code.
parent
5e4a502f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
30 additions
and
33 deletions
+30
-33
cache.h
bin/varnishd/cache.h
+2
-2
cache_center.c
bin/varnishd/cache_center.c
+1
-1
cache_esi_deliver.c
bin/varnishd/cache_esi_deliver.c
+1
-1
cache_esi_fetch.c
bin/varnishd/cache_esi_fetch.c
+4
-4
cache_gzip.c
bin/varnishd/cache_gzip.c
+20
-22
cache_response.c
bin/varnishd/cache_response.c
+2
-2
mgt_param.c
bin/varnishd/mgt/mgt_param.c
+0
-1
No files found.
bin/varnishd/cache.h
View file @
5e673e14
...
...
@@ -710,8 +710,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
,
const
char
*
id
);
struct
vgz
*
VGZ_NewGzip
(
struct
sess
*
sp
,
const
char
*
id
);
struct
vgz
*
VGZ_NewUngzip
(
struct
worker
*
wrk
,
int
vsl_id
,
const
char
*
id
);
struct
vgz
*
VGZ_NewGzip
(
struct
worker
*
wrk
,
int
vsl_id
,
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
*
,
void
*
,
ssize_t
len
);
...
...
bin/varnishd/cache_center.c
View file @
5e673e14
...
...
@@ -901,7 +901,7 @@ cnt_streambody(struct sess *sp)
sp
->
wrk
->
sctx
=
&
sctx
;
if
(
sp
->
wrk
->
res_mode
&
RES_GUNZIP
)
{
sctx
.
vgz
=
VGZ_NewUngzip
(
sp
,
"U S -"
);
sctx
.
vgz
=
VGZ_NewUngzip
(
sp
->
wrk
,
sp
->
vsl_id
,
"U S -"
);
sctx
.
obuf
=
obuf
;
sctx
.
obuf_len
=
sizeof
(
obuf
);
}
...
...
bin/varnishd/cache_esi_deliver.c
View file @
5e673e14
...
...
@@ -267,7 +267,7 @@ ESI_Deliver(struct sess *sp)
}
if
(
isgzip
&&
!
sp
->
wrk
->
gzip_resp
)
{
vgz
=
VGZ_NewUngzip
(
sp
,
"U D E"
);
vgz
=
VGZ_NewUngzip
(
sp
->
wrk
,
sp
->
vsl_id
,
"U D E"
);
/* Feed a gzip header to gunzip to make it happy */
VGZ_Ibuf
(
vgz
,
gzip_hdr
,
sizeof
gzip_hdr
);
...
...
bin/varnishd/cache_esi_fetch.c
View file @
5e673e14
...
...
@@ -301,7 +301,7 @@ vfp_esi_begin(struct sess *sp, size_t estimate)
AZ
(
sp
->
wrk
->
vgz_rx
);
if
(
sp
->
wrk
->
is_gzip
&&
sp
->
wrk
->
do_gunzip
)
{
sp
->
wrk
->
vgz_rx
=
VGZ_NewUngzip
(
sp
,
"U F E"
);
sp
->
wrk
->
vgz_rx
=
VGZ_NewUngzip
(
sp
->
wrk
,
sp
->
vsl_id
,
"U F E"
);
VEP_Init
(
sp
,
NULL
);
}
else
if
(
sp
->
wrk
->
is_gunzip
&&
sp
->
wrk
->
do_gzip
)
{
ALLOC_OBJ
(
vef
,
VEF_MAGIC
);
...
...
@@ -309,18 +309,18 @@ vfp_esi_begin(struct sess *sp, size_t estimate)
//vef = (void*)WS_Alloc(sp->ws, sizeof *vef);
//memset(vef, 0, sizeof *vef);
//vef->magic = VEF_MAGIC;
vef
->
vgz
=
VGZ_NewGzip
(
sp
,
"G F E"
);
vef
->
vgz
=
VGZ_NewGzip
(
sp
->
wrk
,
sp
->
vsl_id
,
"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
,
"U F E"
);
sp
->
wrk
->
vgz_rx
=
VGZ_NewUngzip
(
sp
->
wrk
,
sp
->
vsl_id
,
"U F E"
);
ALLOC_OBJ
(
vef
,
VEF_MAGIC
);
AN
(
vef
);
//vef = (void*)WS_Alloc(sp->ws, sizeof *vef);
//memset(vef, 0, sizeof *vef);
//vef->magic = VEF_MAGIC;
vef
->
vgz
=
VGZ_NewGzip
(
sp
,
"G F E"
);
vef
->
vgz
=
VGZ_NewGzip
(
sp
->
wrk
,
sp
->
vsl_id
,
"G F E"
);
AZ
(
sp
->
wrk
->
vef_priv
);
sp
->
wrk
->
vef_priv
=
vef
;
VEP_Init
(
sp
,
vfp_vep_callback
);
...
...
bin/varnishd/cache_gzip.c
View file @
5e673e14
...
...
@@ -77,7 +77,8 @@ struct vgz {
unsigned
magic
;
#define VGZ_MAGIC 0x162df0cb
enum
{
VGZ_GZ
,
VGZ_UN
}
dir
;
struct
sess
*
sess
;
struct
worker
*
wrk
;
int
vsl_id
;
const
char
*
id
;
struct
ws
*
tmp
;
char
*
tmp_snapshot
;
...
...
@@ -113,11 +114,13 @@ vgz_free(voidpf opaque, voidpf address)
*/
static
struct
vgz
*
vgz_alloc_vgz
(
struct
sess
*
sp
,
const
char
*
id
)
vgz_alloc_vgz
(
struct
worker
*
wrk
,
int
vsl_id
,
const
char
*
id
)
{
struct
vgz
*
vg
;
struct
ws
*
ws
=
sp
->
wrk
->
ws
;
struct
ws
*
ws
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
ws
=
wrk
->
ws
;
WS_Assert
(
ws
);
// XXX: we restore workspace in esi:include
// vg = (void*)WS_Alloc(ws, sizeof *vg);
...
...
@@ -125,22 +128,17 @@ vgz_alloc_vgz(struct sess *sp, const char *id)
AN
(
vg
);
memset
(
vg
,
0
,
sizeof
*
vg
);
vg
->
magic
=
VGZ_MAGIC
;
vg
->
sess
=
sp
;
vg
->
wrk
=
wrk
;
vg
->
vsl_id
=
vsl_id
;
vg
->
id
=
id
;
switch
(
params
->
gzip_tmp_space
)
{
case
0
:
/* malloc, the default */
break
;
case
1
:
vg
->
tmp
=
sp
->
ws
;
vg
->
tmp_snapshot
=
WS_Snapshot
(
vg
->
tmp
);
vg
->
vz
.
zalloc
=
vgz_alloc
;
vg
->
vz
.
zfree
=
vgz_free
;
vg
->
vz
.
opaque
=
vg
;
/* malloc, the default */
break
;
case
2
:
vg
->
tmp
=
sp
->
wrk
->
ws
;
vg
->
tmp
=
wrk
->
ws
;
vg
->
tmp_snapshot
=
WS_Snapshot
(
vg
->
tmp
);
vg
->
vz
.
zalloc
=
vgz_alloc
;
vg
->
vz
.
zfree
=
vgz_free
;
...
...
@@ -153,12 +151,12 @@ vgz_alloc_vgz(struct sess *sp, const char *id)
}
struct
vgz
*
VGZ_NewUngzip
(
struct
sess
*
sp
,
const
char
*
id
)
VGZ_NewUngzip
(
struct
worker
*
wrk
,
int
vsl_id
,
const
char
*
id
)
{
struct
vgz
*
vg
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS
_MAGIC
);
vg
=
vgz_alloc_vgz
(
sp
,
id
);
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER
_MAGIC
);
vg
=
vgz_alloc_vgz
(
wrk
,
vsl_id
,
id
);
vg
->
dir
=
VGZ_UN
;
VSC_C_main
->
n_gunzip
++
;
...
...
@@ -173,13 +171,13 @@ VGZ_NewUngzip(struct sess *sp, const char *id)
}
struct
vgz
*
VGZ_NewGzip
(
struct
sess
*
sp
,
const
char
*
id
)
VGZ_NewGzip
(
struct
worker
*
wrk
,
int
vsl_id
,
const
char
*
id
)
{
struct
vgz
*
vg
;
int
i
;
CHECK_OBJ_NOTNULL
(
sp
,
SESS
_MAGIC
);
vg
=
vgz_alloc_vgz
(
sp
,
id
);
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER
_MAGIC
);
vg
=
vgz_alloc_vgz
(
wrk
,
vsl_id
,
id
);
vg
->
dir
=
VGZ_GZ
;
VSC_C_main
->
n_gzip
++
;
...
...
@@ -413,7 +411,7 @@ VGZ_Destroy(struct vgz **vgp)
CHECK_OBJ_NOTNULL
(
vg
,
VGZ_MAGIC
);
*
vgp
=
NULL
;
WS
P
(
vg
->
sess
,
SLT_Gzip
,
"%s %jd %jd %jd %jd %jd"
,
WS
L
(
vg
->
wrk
,
SLT_Gzip
,
vg
->
vsl_id
,
"%s %jd %jd %jd %jd %jd"
,
vg
->
id
,
(
intmax_t
)
vg
->
vz
.
total_in
,
(
intmax_t
)
vg
->
vz
.
total_out
,
...
...
@@ -440,7 +438,7 @@ vfp_gunzip_begin(struct sess *sp, size_t estimate)
{
(
void
)
estimate
;
AZ
(
sp
->
wrk
->
vgz_rx
);
sp
->
wrk
->
vgz_rx
=
VGZ_NewUngzip
(
sp
,
"U F -"
);
sp
->
wrk
->
vgz_rx
=
VGZ_NewUngzip
(
sp
->
wrk
,
sp
->
vsl_id
,
"U F -"
);
}
static
int
__match_proto__
()
...
...
@@ -516,7 +514,7 @@ vfp_gzip_begin(struct sess *sp, size_t estimate)
(
void
)
estimate
;
AZ
(
sp
->
wrk
->
vgz_rx
);
sp
->
wrk
->
vgz_rx
=
VGZ_NewGzip
(
sp
,
"G F -"
);
sp
->
wrk
->
vgz_rx
=
VGZ_NewGzip
(
sp
->
wrk
,
sp
->
vsl_id
,
"G F -"
);
}
static
int
__match_proto__
()
...
...
@@ -598,7 +596,7 @@ static void __match_proto__()
vfp_testgzip_begin
(
struct
sess
*
sp
,
size_t
estimate
)
{
(
void
)
estimate
;
sp
->
wrk
->
vgz_rx
=
VGZ_NewUngzip
(
sp
,
"u F -"
);
sp
->
wrk
->
vgz_rx
=
VGZ_NewUngzip
(
sp
->
wrk
,
sp
->
vsl_id
,
"u F -"
);
CHECK_OBJ_NOTNULL
(
sp
->
wrk
->
vgz_rx
,
VGZ_MAGIC
);
}
...
...
bin/varnishd/cache_response.c
View file @
5e673e14
...
...
@@ -151,7 +151,7 @@ RES_BuildHttp(const struct sess *sp)
*/
static
void
res_WriteGunzipObj
(
struct
sess
*
sp
)
res_WriteGunzipObj
(
const
struct
sess
*
sp
)
{
struct
storage
*
st
;
unsigned
u
=
0
;
...
...
@@ -162,7 +162,7 @@ res_WriteGunzipObj(struct sess *sp)
CHECK_OBJ_NOTNULL
(
sp
,
SESS_MAGIC
);
vg
=
VGZ_NewUngzip
(
sp
,
"U D -"
);
vg
=
VGZ_NewUngzip
(
sp
->
wrk
,
sp
->
vsl_id
,
"U D -"
);
VGZ_Obuf
(
vg
,
obuf
,
sizeof
obuf
);
VTAILQ_FOREACH
(
st
,
&
sp
->
obj
->
store
,
list
)
{
...
...
bin/varnishd/mgt/mgt_param.c
View file @
5e673e14
...
...
@@ -882,7 +882,6 @@ static const struct parspec input_parspec[] = {
{
"gzip_tmp_space"
,
tweak_uint
,
&
master
.
gzip_tmp_space
,
0
,
2
,
"Where temporary space for gzip/gunzip is allocated:
\n
"
" 0 - malloc
\n
"
" 1 - session workspace
\n
"
" 2 - thread workspace
\n
"
"If you have much gzip/gunzip activity, it may be an"
" advantage to use workspace for these allocations to reduce"
...
...
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