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
88298f16
Commit
88298f16
authored
Mar 12, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More sp -> req argument weakening
parent
c92ad59c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
cache.h
bin/varnishd/cache/cache.h
+2
-2
cache_expire.c
bin/varnishd/cache/cache_expire.c
+11
-11
cache_hash.c
bin/varnishd/cache/cache_hash.c
+2
-2
No files found.
bin/varnishd/cache/cache.h
View file @
88298f16
...
...
@@ -749,8 +749,8 @@ void EXP_Set_ttl(struct exp *e, double v);
void
EXP_Set_grace
(
struct
exp
*
e
,
double
v
);
void
EXP_Set_keep
(
struct
exp
*
e
,
double
v
);
double
EXP_Ttl
(
const
struct
sess
*
,
const
struct
object
*
);
double
EXP_Grace
(
const
struct
sess
*
,
const
struct
object
*
);
double
EXP_Ttl
(
const
struct
req
*
,
const
struct
object
*
);
double
EXP_Grace
(
const
struct
req
*
,
const
struct
object
*
);
void
EXP_Insert
(
struct
object
*
o
);
void
EXP_Inject
(
struct
objcore
*
oc
,
struct
lru
*
lru
,
double
when
);
void
EXP_Init
(
void
);
...
...
bin/varnishd/cache/cache_expire.c
View file @
88298f16
...
...
@@ -109,39 +109,39 @@ EXP_ACCESS(keep, 0.,)
*/
static
double
EXP_Keep
(
const
struct
sess
*
sp
,
const
struct
object
*
o
)
EXP_Keep
(
const
struct
req
*
req
,
const
struct
object
*
o
)
{
double
r
;
r
=
(
double
)
cache_param
->
default_keep
;
if
(
o
->
exp
.
keep
>
0
.)
r
=
o
->
exp
.
keep
;
if
(
sp
!=
NULL
&&
sp
->
req
->
exp
.
keep
>
0
.
&&
sp
->
req
->
exp
.
keep
<
r
)
r
=
sp
->
req
->
exp
.
keep
;
return
(
EXP_Ttl
(
sp
,
o
)
+
r
);
if
(
req
!=
NULL
&&
req
->
exp
.
keep
>
0
.
&&
req
->
exp
.
keep
<
r
)
r
=
req
->
exp
.
keep
;
return
(
EXP_Ttl
(
req
,
o
)
+
r
);
}
double
EXP_Grace
(
const
struct
sess
*
sp
,
const
struct
object
*
o
)
EXP_Grace
(
const
struct
req
*
req
,
const
struct
object
*
o
)
{
double
r
;
r
=
(
double
)
cache_param
->
default_grace
;
if
(
o
->
exp
.
grace
>=
0
.)
r
=
o
->
exp
.
grace
;
if
(
sp
!=
NULL
&&
sp
->
req
->
exp
.
grace
>
0
.
&&
sp
->
req
->
exp
.
grace
<
r
)
r
=
sp
->
req
->
exp
.
grace
;
return
(
EXP_Ttl
(
sp
,
o
)
+
r
);
if
(
req
!=
NULL
&&
req
->
exp
.
grace
>
0
.
&&
req
->
exp
.
grace
<
r
)
r
=
req
->
exp
.
grace
;
return
(
EXP_Ttl
(
req
,
o
)
+
r
);
}
double
EXP_Ttl
(
const
struct
sess
*
sp
,
const
struct
object
*
o
)
EXP_Ttl
(
const
struct
req
*
req
,
const
struct
object
*
o
)
{
double
r
;
r
=
o
->
exp
.
ttl
;
if
(
sp
!=
NULL
&&
sp
->
req
->
exp
.
ttl
>
0
.
&&
sp
->
req
->
exp
.
ttl
<
r
)
r
=
sp
->
req
->
exp
.
ttl
;
if
(
req
!=
NULL
&&
req
->
exp
.
ttl
>
0
.
&&
req
->
exp
.
ttl
<
r
)
r
=
req
->
exp
.
ttl
;
return
(
o
->
exp
.
entered
+
r
);
}
...
...
bin/varnishd/cache/cache_hash.c
View file @
88298f16
...
...
@@ -357,14 +357,14 @@ HSH_Lookup(struct sess *sp)
continue
;
/* If still valid, use it */
if
(
EXP_Ttl
(
sp
,
o
)
>=
sp
->
t_req
)
if
(
EXP_Ttl
(
req
,
o
)
>=
sp
->
t_req
)
break
;
/*
* Remember any matching objects inside their grace period
* and if there are several, use the least expired one.
*/
if
(
EXP_Grace
(
sp
,
o
)
>=
sp
->
t_req
)
{
if
(
EXP_Grace
(
req
,
o
)
>=
sp
->
t_req
)
{
if
(
grace_oc
==
NULL
||
grace_ttl
<
o
->
exp
.
entered
+
o
->
exp
.
ttl
)
{
grace_oc
=
oc
;
...
...
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