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
d1f1a6dd
Commit
d1f1a6dd
authored
Feb 21, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Gently shuffle things around a bit.
parent
d2a7d10f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
26 deletions
+21
-26
cache_expire.c
bin/varnishd/cache/cache_expire.c
+2
-1
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+14
-24
cache_hash.c
bin/varnishd/cache/cache_hash.c
+5
-1
No files found.
bin/varnishd/cache/cache_expire.c
View file @
d1f1a6dd
...
...
@@ -234,6 +234,8 @@ EXP_Rearm(struct object *o, double now, double ttl, double grace, double keep)
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
assert
(
oc
->
refcnt
>
0
);
AN
(
oc
->
flags
&
OC_F_EXP
);
if
(
!
isnan
(
ttl
))
o
->
exp
.
ttl
=
now
+
ttl
-
o
->
exp
.
t_origin
;
if
(
!
isnan
(
grace
))
...
...
@@ -253,7 +255,6 @@ EXP_Rearm(struct object *o, double now, double ttl, double grace, double keep)
CHECK_OBJ_NOTNULL
(
lru
,
LRU_MAGIC
);
Lck_Lock
(
&
lru
->
mtx
);
AN
(
oc
->
flags
&
OC_F_EXP
);
if
(
!
isnan
(
now
)
&&
when
<=
now
)
oc
->
flags
|=
OC_F_DYING
;
...
...
bin/varnishd/cache/cache_fetch.c
View file @
d1f1a6dd
...
...
@@ -56,10 +56,11 @@ vbf_release_req(struct busyobj *bo)
}
/*--------------------------------------------------------------------
* Turn the beresp into a obj
*/
static
int
vbf_bere
q
2obj
(
struct
worker
*
wrk
,
struct
busyobj
*
bo
)
vbf_bere
sp
2obj
(
struct
worker
*
wrk
,
struct
busyobj
*
bo
)
{
unsigned
l
;
char
*
b
;
...
...
@@ -157,8 +158,6 @@ vbf_bereq2obj(struct worker *wrk, struct busyobj *bo)
else
obj
->
last_modified
=
floor
(
bo
->
exp
.
t_origin
);
assert
(
WRW_IsReleased
(
wrk
));
return
(
0
);
}
...
...
@@ -302,16 +301,16 @@ vbf_stp_fetchhdr(struct worker *wrk, struct busyobj *bo)
i
=
V1F_fetch_hdr
(
wrk
,
bo
,
bo
->
req
);
}
if
(
bo
->
do_pass
&&
bo
->
req
!=
NULL
)
vbf_release_req
(
bo
);
/* XXX : retry ?? */
AZ
(
bo
->
req
);
if
(
i
)
{
AZ
(
bo
->
vbc
);
return
(
F_STP_ERROR
);
}
if
(
bo
->
do_pass
&&
bo
->
req
!=
NULL
)
vbf_release_req
(
bo
);
/* XXX : retry ?? */
AZ
(
bo
->
req
);
AN
(
bo
->
vbc
);
http_VSL_log
(
bo
->
beresp
);
...
...
@@ -463,13 +462,15 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
if
(
bo
->
htc
.
body_status
==
BS_NONE
)
bo
->
do_stream
=
0
;
if
(
vbf_bere
q
2obj
(
wrk
,
bo
))
{
if
(
vbf_bere
sp
2obj
(
wrk
,
bo
))
{
bo
->
stats
=
NULL
;
(
void
)
VFP_Error
(
bo
,
"Could not get storage"
);
VDI_CloseFd
(
&
bo
->
vbc
);
return
(
F_STP_DONE
);
}
assert
(
WRW_IsReleased
(
wrk
));
obj
=
bo
->
fetch_obj
;
/*
...
...
@@ -536,11 +537,6 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
if
(
!
bo
->
do_stream
&&
bo
->
state
!=
BOS_FAILED
)
HSH_Unbusy
(
&
wrk
->
stats
,
obj
->
objcore
);
if
(
bo
->
state
!=
BOS_FAILED
&&
!
(
obj
->
objcore
->
flags
&
OC_F_PRIVATE
))
{
EXP_Insert
(
obj
->
objcore
);
AN
(
obj
->
objcore
->
ban
);
}
HSH_Complete
(
obj
->
objcore
);
assert
(
bo
->
refcount
>=
1
);
...
...
@@ -615,10 +611,6 @@ vbf_stp_condfetch(struct worker *wrk, struct busyobj *bo)
VBO_setstate
(
bo
,
BOS_FETCHING
);
HSH_Unbusy
(
&
wrk
->
stats
,
obj
->
objcore
);
if
(
!
(
obj
->
objcore
->
flags
&
OC_F_PRIVATE
))
{
EXP_Insert
(
obj
->
objcore
);
AN
(
obj
->
objcore
->
ban
);
}
st
=
NULL
;
al
=
0
;
...
...
@@ -683,19 +675,17 @@ vbf_stp_error(struct worker *wrk, struct busyobj *bo)
xxxassert
(
wrk
->
handling
==
VCL_RET_DELIVER
);
if
(
bo
->
req
!=
NULL
)
vbf_release_req
(
bo
);
http_PrintfHeader
(
bo
->
beresp
,
"Content-Length: %jd"
,
(
intmax_t
)
0
);
http_PrintfHeader
(
bo
->
beresp
,
"X-XXXPHK: yes"
);
if
(
vbf_bere
q
2obj
(
wrk
,
bo
))
{
if
(
vbf_bere
sp
2obj
(
wrk
,
bo
))
{
INCOMPL
();
}
HSH_Unbusy
(
&
wrk
->
stats
,
bo
->
fetch_obj
->
objcore
);
if
(
!
(
bo
->
fetch_obj
->
objcore
->
flags
&
OC_F_PRIVATE
))
{
EXP_Insert
(
bo
->
fetch_obj
->
objcore
);
AN
(
bo
->
fetch_obj
->
objcore
->
ban
);
}
VBO_setstate
(
bo
,
BOS_FINISHED
);
HSH_Complete
(
bo
->
fetch_obj
->
objcore
);
return
(
F_STP_DONE
);
...
...
bin/varnishd/cache/cache_hash.c
View file @
d1f1a6dd
...
...
@@ -678,8 +678,12 @@ HSH_Unbusy(struct dstat *ds, struct objcore *oc)
if
(
oh
->
waitinglist
!=
NULL
)
hsh_rush
(
ds
,
oh
);
Lck_Unlock
(
&
oh
->
mtx
);
if
(
!
(
oc
->
flags
&
OC_F_PRIVATE
))
if
(
!
(
oc
->
flags
&
OC_F_PRIVATE
))
{
BAN_NewObjCore
(
oc
);
EXP_Insert
(
oc
);
AN
(
oc
->
flags
&
OC_F_EXP
);
AN
(
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