Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
unique-xids
Commits
dbd7ddc0
Commit
dbd7ddc0
authored
Nov 19, 2012
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow reload of a series of persisted ban specs in one go.
parent
fef35edc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
8 deletions
+28
-8
cache_ban.c
bin/varnishd/cache/cache_ban.c
+28
-8
No files found.
bin/varnishd/cache/cache_ban.c
View file @
dbd7ddc0
...
...
@@ -573,29 +573,25 @@ BAN_RefBan(struct objcore *oc, double t0, const struct ban *tail)
* mark any older bans, with the same condition, GONE as well.
*/
void
BAN_R
eload
(
const
uint8_t
*
ban
,
unsigned
len
)
static
void
ban_r
eload
(
const
uint8_t
*
ban
,
unsigned
len
)
{
struct
ban
*
b
,
*
b2
;
int
gone
=
0
;
double
t0
,
t1
,
t2
=
9e99
;
ASSERT_CLI
();
AZ
(
ban_shutdown
);
Lck_AssertHeld
(
&
ban_mtx
);
t0
=
ban_time
(
ban
);
assert
(
len
==
ban_len
(
ban
));
Lck_Lock
(
&
ban_mtx
);
VTAILQ_FOREACH
(
b
,
&
ban_head
,
list
)
{
t1
=
ban_time
(
b
->
spec
);
assert
(
t1
<
t2
);
t2
=
t1
;
if
(
t1
==
t0
)
{
Lck_Unlock
(
&
ban_mtx
);
if
(
t1
==
t0
)
return
;
}
if
(
t1
<
t0
)
break
;
if
(
ban_equal
(
b
->
spec
,
ban
))
{
...
...
@@ -632,6 +628,30 @@ BAN_Reload(const uint8_t *ban, unsigned len)
VSC_C_main
->
bans_dups
++
;
}
}
}
/*--------------------------------------------------------------------
* Reload a series of persisted ban specs
*/
void
BAN_Reload
(
const
uint8_t
*
ptr
,
unsigned
len
)
{
const
uint8_t
*
pe
;
unsigned
l
;
AZ
(
ban_shutdown
);
pe
=
ptr
+
len
;
Lck_Lock
(
&
ban_mtx
);
while
(
ptr
<
pe
)
{
/* XXX: This can be optimized by traversing the live
* ban list together with the reload list (combining
* the loops in BAN_Reload and ban_reload). */
l
=
ban_len
(
ptr
);
assert
(
ptr
+
l
<=
pe
);
ban_reload
(
ptr
,
l
);
ptr
+=
l
;
}
Lck_Unlock
(
&
ban_mtx
);
}
...
...
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