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
d46391fa
Commit
d46391fa
authored
Dec 11, 2018
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't recache req->vcl in wrk unless it will speed things up later.
parent
2fe1e1aa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
9 deletions
+25
-9
cache_req.c
bin/varnishd/cache/cache_req.c
+2
-6
cache_varnishd.h
bin/varnishd/cache/cache_varnishd.h
+1
-0
cache_vrt_vcl.c
bin/varnishd/cache/cache_vrt_vcl.c
+22
-3
No files found.
bin/varnishd/cache/cache_req.c
View file @
d46391fa
...
...
@@ -217,12 +217,8 @@ Req_Cleanup(struct sess *sp, struct worker *wrk, struct req *req)
AZ
(
req
->
esi_level
);
AZ
(
req
->
privs
->
magic
);
if
(
req
->
vcl
!=
NULL
)
{
if
(
wrk
->
vcl
!=
NULL
)
VCL_Rel
(
&
wrk
->
vcl
);
wrk
->
vcl
=
req
->
vcl
;
req
->
vcl
=
NULL
;
}
if
(
req
->
vcl
!=
NULL
)
VCL_Recache
(
wrk
,
&
req
->
vcl
);
/* Charge and log byte counters */
if
(
req
->
vsl
->
wid
)
{
...
...
bin/varnishd/cache/cache_varnishd.h
View file @
d46391fa
...
...
@@ -382,6 +382,7 @@ void VCL_Panic(struct vsb *, const struct vcl *);
void
VCL_Poll
(
void
);
void
VCL_Ref
(
struct
vcl
*
);
void
VCL_Refresh
(
struct
vcl
**
);
void
VCL_Recache
(
struct
worker
*
,
struct
vcl
**
);
void
VCL_Rel
(
struct
vcl
**
);
void
VCL_TaskEnter
(
const
struct
vcl
*
,
struct
vrt_privs
*
);
void
VCL_TaskLeave
(
const
struct
vcl
*
,
struct
vrt_privs
*
);
...
...
bin/varnishd/cache/cache_vrt_vcl.c
View file @
d46391fa
...
...
@@ -76,17 +76,36 @@ VCL_Method_Name(unsigned m)
void
VCL_Refresh
(
struct
vcl
**
vcc
)
{
while
(
vcl_active
==
NULL
)
(
void
)
usleep
(
100000
);
if
(
*
vcc
==
vcl_active
)
return
;
if
(
*
vcc
!=
NULL
)
VCL_Rel
(
vcc
);
/* XXX: optimize locking */
while
(
vcl_active
==
NULL
)
(
void
)
usleep
(
100000
);
vcl_get
(
vcc
,
NULL
);
}
void
VCL_Recache
(
struct
worker
*
wrk
,
struct
vcl
**
vclp
)
{
AN
(
wrk
);
AN
(
vclp
);
CHECK_OBJ_NOTNULL
(
*
vclp
,
VCL_MAGIC
);
if
(
*
vclp
!=
vcl_active
||
wrk
->
vcl
==
vcl_active
)
{
VCL_Rel
(
vclp
);
return
;
}
if
(
wrk
->
vcl
!=
NULL
)
VCL_Rel
(
&
wrk
->
vcl
);
wrk
->
vcl
=
*
vclp
;
*
vclp
=
NULL
;
}
void
VCL_Ref
(
struct
vcl
*
vcl
)
{
...
...
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