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
cf81441e
Commit
cf81441e
authored
Mar 12, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tag oc's with COMPLETE or FAILURE when we fetch the body.
parent
88298f16
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
2 deletions
+15
-2
cache.h
bin/varnishd/cache/cache.h
+2
-0
cache_center.c
bin/varnishd/cache/cache_center.c
+5
-2
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+7
-0
cache_hash.c
bin/varnishd/cache/cache_hash.c
+1
-0
No files found.
bin/varnishd/cache/cache.h
View file @
cf81441e
...
...
@@ -381,6 +381,8 @@ struct objcore {
#define OC_F_LRUDONTMOVE (1<<4)
#define OC_F_PRIV (1<<5)
/* Stevedore private flag */
#define OC_F_LURK (3<<6)
/* Ban-lurker-color */
#define OC_F_COMPLETE (1<<8)
#define OC_F_FAILED (1<<9)
unsigned
timer_idx
;
VTAILQ_ENTRY
(
objcore
)
list
;
VTAILQ_ENTRY
(
objcore
)
lru_list
;
...
...
bin/varnishd/cache/cache_center.c
View file @
cf81441e
...
...
@@ -921,9 +921,9 @@ cnt_fetchbody(struct sess *sp, struct worker *wrk, struct req *req)
AN
(
req
->
director
);
if
(
bo
->
state
==
BOS_FAILED
)
{
HSH_Drop
(
wrk
,
&
sp
->
req
->
obj
);
VBO_DerefBusyObj
(
wrk
,
&
req
->
busyobj
);
HSH_Drop
(
wrk
,
&
req
->
obj
);
AZ
(
req
->
obj
);
VBO_DerefBusyObj
(
wrk
,
&
req
->
busyobj
);
req
->
err_code
=
503
;
sp
->
step
=
STP_ERROR
;
return
(
0
);
...
...
@@ -1145,6 +1145,9 @@ cnt_lookup(struct sess *sp, struct worker *wrk, struct req *req)
return
(
0
);
}
/* For now... */
AN
(
oc
->
flags
&
(
OC_F_COMPLETE
|
OC_F_FAILED
));
o
=
oc_getobj
(
&
wrk
->
stats
,
oc
);
CHECK_OBJ_NOTNULL
(
o
,
OBJECT_MAGIC
);
req
->
obj
=
o
;
...
...
bin/varnishd/cache/cache_fetch.c
View file @
cf81441e
...
...
@@ -634,6 +634,13 @@ FetchBody(struct worker *wrk, void *priv)
http_Teardown
(
bo
->
bereq
);
http_Teardown
(
bo
->
beresp
);
if
(
obj
->
objcore
!=
NULL
)
{
/* pass has no objcore */
/* XXX: lock protection ?? */
obj
->
objcore
->
flags
|=
(
bo
->
state
==
BOS_FAILED
?
OC_F_FAILED
:
OC_F_COMPLETE
);
}
if
(
bo
->
state
==
BOS_FAILED
)
{
wrk
->
stats
.
fetch_failed
++
;
VDI_CloseFd
(
&
bo
->
vbc
);
...
...
bin/varnishd/cache/cache_hash.c
View file @
cf81441e
...
...
@@ -269,6 +269,7 @@ HSH_Insert(struct worker *wrk, const void *digest, struct objcore *oc)
oc
->
refcnt
=
1
;
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
AZ
(
oc
->
flags
&
OC_F_BUSY
);
oc
->
flags
|=
OC_F_COMPLETE
;
VTAILQ_INSERT_HEAD
(
&
oh
->
objcs
,
oc
,
list
);
/* NB: do not deref objhead the new object inherits our reference */
...
...
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