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
b7507f94
Commit
b7507f94
authored
Jan 10, 2024
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hash: New HSH_Replace() function
parent
241be56b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
2 deletions
+16
-2
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+1
-1
cache_hash.c
bin/varnishd/cache/cache_hash.c
+12
-1
cache_objhead.h
bin/varnishd/cache/cache_objhead.h
+1
-0
b00039.vtc
bin/varnishtest/tests/b00039.vtc
+2
-0
No files found.
bin/varnishd/cache/cache_fetch.c
View file @
b7507f94
...
...
@@ -756,7 +756,7 @@ vbf_stp_fetchend(struct worker *wrk, struct busyobj *bo)
VSL
(
SLT_ExpKill
,
NO_VXID
,
"VBF_Superseded x=%ju n=%ju"
,
VXID
(
ObjGetXID
(
wrk
,
bo
->
stale_oc
)),
VXID
(
ObjGetXID
(
wrk
,
bo
->
fetch_objcore
)));
HSH_
Kill
(
bo
->
stale_oc
);
HSH_
Replace
(
bo
->
stale_oc
,
bo
->
fetch_objcore
);
}
return
(
F_STP_DONE
);
}
...
...
bin/varnishd/cache/cache_hash.c
View file @
b7507f94
...
...
@@ -911,15 +911,26 @@ HSH_Unbusy(struct worker *wrk, struct objcore *oc)
void
HSH_Kill
(
struct
objcore
*
oc
)
{
HSH_Replace
(
oc
,
NULL
);
}
void
HSH_Replace
(
struct
objcore
*
oc
,
const
struct
objcore
*
new_oc
)
{
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
CHECK_OBJ_NOTNULL
(
oc
->
objhead
,
OBJHEAD_MAGIC
);
if
(
new_oc
!=
NULL
)
{
CHECK_OBJ
(
new_oc
,
OBJCORE_MAGIC
);
assert
(
oc
->
objhead
==
new_oc
->
objhead
);
}
Lck_Lock
(
&
oc
->
objhead
->
mtx
);
oc
->
flags
|=
OC_F_DYING
;
Lck_Unlock
(
&
oc
->
objhead
->
mtx
);
EXP_Remove
(
oc
,
NULL
);
EXP_Remove
(
oc
,
new_oc
);
}
/*====================================================================
...
...
bin/varnishd/cache/cache_objhead.h
View file @
b7507f94
...
...
@@ -67,6 +67,7 @@ enum lookup_e {
void
HSH_Fail
(
struct
objcore
*
);
void
HSH_Kill
(
struct
objcore
*
);
void
HSH_Replace
(
struct
objcore
*
,
const
struct
objcore
*
);
void
HSH_Insert
(
struct
worker
*
,
const
void
*
hash
,
struct
objcore
*
,
struct
ban
*
);
void
HSH_Unbusy
(
struct
worker
*
,
struct
objcore
*
);
...
...
bin/varnishtest/tests/b00039.vtc
View file @
b7507f94
...
...
@@ -67,3 +67,5 @@ client c1 {
} -run
logexpect l1 -wait
varnish v1 -expect MAIN.n_superseded == 2
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