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
4442c6d7
Commit
4442c6d7
authored
Apr 07, 2019
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move busyobj cancel handling to a seprate function
parent
c9b9c6bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
9 deletions
+31
-9
cache_hash.c
bin/varnishd/cache/cache_hash.c
+29
-0
cache_objhead.h
bin/varnishd/cache/cache_objhead.h
+1
-0
cache_req_fsm.c
bin/varnishd/cache/cache_req_fsm.c
+1
-9
No files found.
bin/varnishd/cache/cache_hash.c
View file @
4442c6d7
...
@@ -765,6 +765,35 @@ HSH_Abandon(struct objcore *oc)
...
@@ -765,6 +765,35 @@ HSH_Abandon(struct objcore *oc)
Lck_Unlock
(
&
oh
->
mtx
);
Lck_Unlock
(
&
oh
->
mtx
);
}
}
/*---------------------------------------------------------------------
* Cancel a fetch when the client does not need it any more
*/
void
HSH_Cancel
(
struct
worker
*
wrk
,
struct
objcore
*
oc
,
struct
boc
*
boc
)
{
struct
boc
*
bocref
=
NULL
;
if
((
oc
->
flags
&
(
OC_F_PRIVATE
|
OC_F_HFM
|
OC_F_HFP
))
==
0
)
return
;
if
(
boc
==
NULL
)
bocref
=
boc
=
HSH_RefBoc
(
oc
);
if
(
oc
->
flags
&
OC_F_HFP
)
AN
(
oc
->
flags
&
OC_F_HFM
);
if
(
boc
!=
NULL
)
{
HSH_Abandon
(
oc
);
ObjWaitState
(
oc
,
BOS_FINISHED
);
}
if
(
bocref
!=
NULL
)
HSH_DerefBoc
(
wrk
,
oc
);
ObjSlim
(
wrk
,
oc
);
}
/*---------------------------------------------------------------------
/*---------------------------------------------------------------------
* Unbusy an objcore when the object is completely fetched.
* Unbusy an objcore when the object is completely fetched.
*/
*/
...
...
bin/varnishd/cache/cache_objhead.h
View file @
4442c6d7
...
@@ -74,3 +74,4 @@ unsigned HSH_Purge(struct worker *, struct objhead *, vtim_real ttl_now,
...
@@ -74,3 +74,4 @@ unsigned HSH_Purge(struct worker *, struct objhead *, vtim_real ttl_now,
vtim_dur
ttl
,
vtim_dur
grace
,
vtim_dur
keep
);
vtim_dur
ttl
,
vtim_dur
grace
,
vtim_dur
keep
);
struct
objcore
*
HSH_Private
(
const
struct
worker
*
wrk
);
struct
objcore
*
HSH_Private
(
const
struct
worker
*
wrk
);
void
HSH_Abandon
(
struct
objcore
*
oc
);
void
HSH_Abandon
(
struct
objcore
*
oc
);
void
HSH_Cancel
(
struct
worker
*
,
struct
objcore
*
,
struct
boc
*
);
bin/varnishd/cache/cache_req_fsm.c
View file @
4442c6d7
...
@@ -404,15 +404,7 @@ cnt_transmit(struct worker *wrk, struct req *req)
...
@@ -404,15 +404,7 @@ cnt_transmit(struct worker *wrk, struct req *req)
VSLb_ts_req
(
req
,
"Resp"
,
W_TIM_real
(
wrk
));
VSLb_ts_req
(
req
,
"Resp"
,
W_TIM_real
(
wrk
));
if
(
req
->
objcore
->
flags
&
(
OC_F_PRIVATE
|
OC_F_HFM
|
OC_F_HFP
))
{
HSH_Cancel
(
wrk
,
req
->
objcore
,
boc
);
if
(
req
->
objcore
->
flags
&
OC_F_HFP
)
AN
(
req
->
objcore
->
flags
&
OC_F_HFM
);
if
(
boc
!=
NULL
)
{
HSH_Abandon
(
req
->
objcore
);
ObjWaitState
(
req
->
objcore
,
BOS_FINISHED
);
}
ObjSlim
(
wrk
,
req
->
objcore
);
}
if
(
boc
!=
NULL
)
if
(
boc
!=
NULL
)
HSH_DerefBoc
(
wrk
,
req
->
objcore
);
HSH_DerefBoc
(
wrk
,
req
->
objcore
);
...
...
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