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
e654cc8a
Commit
e654cc8a
authored
Jun 26, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move busyobj->exp to bo->fetch_objcore->exp
parent
8070f329
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
26 deletions
+33
-26
cache.h
bin/varnishd/cache/cache.h
+2
-1
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+15
-13
cache_rfc2616.c
bin/varnishd/cache/cache_rfc2616.c
+1
-1
cache_vrt_var.c
bin/varnishd/cache/cache_vrt_var.c
+6
-6
stevedore.c
bin/varnishd/storage/stevedore.c
+2
-1
storage_persistent.c
bin/varnishd/storage/storage_persistent.c
+7
-4
No files found.
bin/varnishd/cache/cache.h
View file @
e654cc8a
...
...
@@ -425,6 +425,8 @@ struct objcore {
struct
busyobj
*
busyobj
;
double
timer_when
;
struct
exp
exp
;
uint16_t
flags
;
#define OC_F_BUSY (1<<1)
#define OC_F_PASS (1<<2)
...
...
@@ -553,7 +555,6 @@ struct busyobj {
struct
objcore
*
fetch_objcore
;
struct
object
*
fetch_obj
;
struct
exp
exp
;
struct
http_conn
htc
;
struct
pool_task
fetch_task
;
...
...
bin/varnishd/cache/cache_fetch.c
View file @
e654cc8a
...
...
@@ -49,13 +49,15 @@ static struct object *
vbf_allocobj
(
struct
busyobj
*
bo
,
unsigned
l
,
uint16_t
nhttp
)
{
struct
object
*
obj
;
struct
objcore
*
oc
;
const
char
*
storage_hint
;
double
lifetime
;
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
->
fetch_objcore
,
OBJCORE_MAGIC
);
oc
=
bo
->
fetch_objcore
;
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
lifetime
=
bo
->
exp
.
ttl
+
bo
->
exp
.
grace
+
bo
->
exp
.
keep
;
lifetime
=
oc
->
exp
.
ttl
+
oc
->
exp
.
grace
+
oc
->
exp
.
keep
;
if
(
bo
->
uncacheable
||
lifetime
<
cache_param
->
shortlived
)
storage_hint
=
TRANSIENT_STORAGE
;
...
...
@@ -77,10 +79,10 @@ vbf_allocobj(struct busyobj *bo, unsigned l, uint16_t nhttp)
* on Transient storage.
*/
if
(
bo
->
exp
.
ttl
>
cache_param
->
shortlived
)
bo
->
exp
.
ttl
=
cache_param
->
shortlived
;
bo
->
exp
.
grace
=
0
.
0
;
bo
->
exp
.
keep
=
0
.
0
;
if
(
oc
->
exp
.
ttl
>
cache_param
->
shortlived
)
oc
->
exp
.
ttl
=
cache_param
->
shortlived
;
oc
->
exp
.
grace
=
0
.
0
;
oc
->
exp
.
keep
=
0
.
0
;
obj
=
STV_NewObject
(
bo
,
TRANSIENT_STORAGE
,
l
,
nhttp
);
return
(
obj
);
}
...
...
@@ -162,7 +164,7 @@ vbf_beresp2obj(struct busyobj *bo)
if
(
http_GetHdr
(
hp
,
H_Last_Modified
,
&
b
))
obj
->
last_modified
=
VTIM_parse
(
b
);
else
obj
->
last_modified
=
floor
(
bo
->
exp
.
t_origin
);
obj
->
last_modified
=
floor
(
bo
->
fetch_objcore
->
exp
.
t_origin
);
/* Disassociate the obj from the bo's workspace */
hp2
->
ws
=
NULL
;
...
...
@@ -348,12 +350,12 @@ vbf_stp_startfetch(struct worker *wrk, struct busyobj *bo)
/*
* What does RFC2616 think about TTL ?
*/
EXP_Clr
(
&
bo
->
exp
);
EXP_Clr
(
&
bo
->
fetch_objcore
->
exp
);
RFC2616_Ttl
(
bo
,
now
);
/* private objects have negative TTL */
if
(
bo
->
fetch_objcore
->
flags
&
OC_F_PRIVATE
)
bo
->
exp
.
ttl
=
-
1
.;
bo
->
fetch_objcore
->
exp
.
ttl
=
-
1
.;
AZ
(
bo
->
do_esi
);
...
...
@@ -696,10 +698,10 @@ vbf_stp_error(struct worker *wrk, struct busyobj *bo)
http_PrintfHeader
(
bo
->
beresp
,
"Date: %s"
,
time_str
);
http_SetHeader
(
bo
->
beresp
,
"Server: Varnish"
);
bo
->
exp
.
t_origin
=
bo
->
t_prev
;
bo
->
exp
.
ttl
=
0
;
bo
->
exp
.
grace
=
0
;
bo
->
exp
.
keep
=
0
;
bo
->
fetch_objcore
->
exp
.
t_origin
=
bo
->
t_prev
;
bo
->
fetch_objcore
->
exp
.
ttl
=
0
;
bo
->
fetch_objcore
->
exp
.
grace
=
0
;
bo
->
fetch_objcore
->
exp
.
keep
=
0
;
VCL_backend_error_method
(
bo
->
vcl
,
wrk
,
NULL
,
bo
,
bo
->
bereq
->
ws
);
...
...
bin/varnishd/cache/cache_rfc2616.c
View file @
e654cc8a
...
...
@@ -72,7 +72,7 @@ RFC2616_Ttl(struct busyobj *bo, double now)
struct
exp
*
expp
;
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
expp
=
&
bo
->
exp
;
expp
=
&
bo
->
fetch_objcore
->
exp
;
hp
=
bo
->
beresp
;
...
...
bin/varnishd/cache/cache_vrt_var.c
View file @
e654cc8a
...
...
@@ -486,12 +486,12 @@ VRT_DO_EXP_R(obj, ctx->req->obj->exp, ttl,
VRT_DO_EXP_R
(
obj
,
ctx
->
req
->
obj
->
exp
,
grace
,
0
)
VRT_DO_EXP_R
(
obj
,
ctx
->
req
->
obj
->
exp
,
keep
,
0
)
VRT_DO_EXP_L
(
beresp
,
ctx
->
bo
->
exp
,
ttl
)
VRT_DO_EXP_R
(
beresp
,
ctx
->
bo
->
exp
,
ttl
,
0
)
VRT_DO_EXP_L
(
beresp
,
ctx
->
bo
->
exp
,
grace
)
VRT_DO_EXP_R
(
beresp
,
ctx
->
bo
->
exp
,
grace
,
0
)
VRT_DO_EXP_L
(
beresp
,
ctx
->
bo
->
exp
,
keep
)
VRT_DO_EXP_R
(
beresp
,
ctx
->
bo
->
exp
,
keep
,
0
)
VRT_DO_EXP_L
(
beresp
,
ctx
->
bo
->
fetch_objcore
->
exp
,
ttl
)
VRT_DO_EXP_R
(
beresp
,
ctx
->
bo
->
fetch_objcore
->
exp
,
ttl
,
0
)
VRT_DO_EXP_L
(
beresp
,
ctx
->
bo
->
fetch_objcore
->
exp
,
grace
)
VRT_DO_EXP_R
(
beresp
,
ctx
->
bo
->
fetch_objcore
->
exp
,
grace
,
0
)
VRT_DO_EXP_L
(
beresp
,
ctx
->
bo
->
fetch_objcore
->
exp
,
keep
)
VRT_DO_EXP_R
(
beresp
,
ctx
->
bo
->
fetch_objcore
->
exp
,
keep
,
0
)
/*--------------------------------------------------------------------
* [be]req.xid
...
...
bin/varnishd/storage/stevedore.c
View file @
e654cc8a
...
...
@@ -286,7 +286,7 @@ STV_MkObject(struct stevedore *stv, struct busyobj *bo,
HTTP_Setup
(
o
->
http
,
bo
->
ws_o
,
bo
->
vsl
,
SLT_ObjMethod
);
o
->
http
->
magic
=
HTTP_MAGIC
;
o
->
exp
=
bo
->
exp
;
o
->
exp
=
bo
->
fetch_objcore
->
exp
;
VTAILQ_INIT
(
&
o
->
store
);
o
->
objcore
=
bo
->
fetch_objcore
;
...
...
@@ -344,6 +344,7 @@ STV_NewObject(struct busyobj *bo, const char *hint,
int
i
;
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
CHECK_OBJ_NOTNULL
(
bo
->
fetch_objcore
,
OBJCORE_MAGIC
);
assert
(
wsl
>
0
);
wsl
=
PRNDUP
(
wsl
);
...
...
bin/varnishd/storage/storage_persistent.c
View file @
e654cc8a
...
...
@@ -517,10 +517,13 @@ smp_allocobj(struct stevedore *stv, struct busyobj *bo,
unsigned
objidx
;
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
if
(
bo
->
fetch_objcore
==
NULL
)
return
(
NULL
);
/* from cnt_error */
CAST_OBJ_NOTNULL
(
sc
,
stv
->
priv
,
SMP_SC_MAGIC
);
AN
((
bo
->
exp
.
ttl
+
bo
->
exp
.
grace
+
bo
->
exp
.
keep
)
>
0
.);
/* Don't entertain already dead objects */
if
((
bo
->
fetch_objcore
->
exp
.
ttl
+
bo
->
fetch_objcore
->
exp
.
grace
+
bo
->
fetch_objcore
->
exp
.
keep
)
<=
0
.)
return
(
NULL
);
ltot
=
IRNUP
(
sc
,
ltot
);
...
...
@@ -546,7 +549,7 @@ smp_allocobj(struct stevedore *stv, struct busyobj *bo,
/* We have to do this somewhere, might as well be here... */
assert
(
sizeof
so
->
hash
==
DIGEST_LEN
);
memcpy
(
so
->
hash
,
oc
->
objhead
->
digest
,
DIGEST_LEN
);
so
->
exp
=
bo
->
exp
;
so
->
exp
=
bo
->
fetch_objcore
->
exp
;
so
->
ptr
=
(
uint8_t
*
)
o
-
sc
->
base
;
so
->
ban
=
BAN_Time
(
oc
->
ban
);
...
...
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