Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishevent3
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
varnishevent3
Commits
7a3c8e2c
Commit
7a3c8e2c
authored
May 14, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store the BAN_F_REQ flag in the encoded specification, so we can
recover it when -spersistent reloads
parent
95d515f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
cache_ban.c
bin/varnishd/cache_ban.c
+9
-12
No files found.
bin/varnishd/cache_ban.c
View file @
7a3c8e2c
...
...
@@ -381,16 +381,15 @@ BAN_Insert(struct ban *b)
ln
=
vsb_len
(
b
->
vsb
);
assert
(
ln
>=
0
);
b
->
spec
=
malloc
(
ln
+
1
2
L
);
/* XXX */
b
->
spec
=
malloc
(
ln
+
1
3
L
);
/* XXX */
XXXAN
(
b
->
spec
);
t0
=
TIM_real
();
memcpy
(
b
->
spec
,
&
t0
,
sizeof
t0
);
vbe32enc
(
b
->
spec
+
8
,
ln
+
12
);
memcpy
(
b
->
spec
+
12
,
vsb_data
(
b
->
vsb
),
ln
);
ln
+=
12
;
b
->
spec
[
12
]
=
(
b
->
flags
&
BAN_F_REQ
)
?
1
:
0
;
memcpy
(
b
->
spec
+
13
,
vsb_data
(
b
->
vsb
),
ln
);
ln
+=
13
;
vbe32enc
(
b
->
spec
+
8
,
ln
);
vsb_delete
(
b
->
vsb
);
b
->
vsb
=
NULL
;
...
...
@@ -542,6 +541,8 @@ BAN_Reload(const uint8_t *ban, unsigned len)
AN
(
b2
->
spec
);
memcpy
(
b2
->
spec
,
ban
,
len
);
b2
->
flags
|=
gone
;
if
(
ban
[
12
])
b2
->
flags
|=
BAN_F_REQ
;
if
(
b
==
NULL
)
VTAILQ_INSERT_TAIL
(
&
ban_head
,
b2
,
list
);
else
...
...
@@ -581,10 +582,6 @@ BAN_Compile(void)
ASSERT_CLI
();
/*
* XXX: we need to derive the BAN_F_REQ flag from all the
* XXX: all the loaded bans
*/
SMP_NewBan
(
ban_magic
->
spec
,
ban_len
(
ban_magic
->
spec
));
ban_start
=
VTAILQ_FIRST
(
&
ban_head
);
}
...
...
@@ -602,7 +599,7 @@ ban_evaluate(const uint8_t *bs, const struct http *objhttp,
char
*
arg1
;
be
=
bs
+
ban_len
(
bs
);
bs
+=
1
2
;
bs
+=
1
3
;
while
(
bs
<
be
)
{
(
*
tests
)
++
;
ban_iter
(
&
bs
,
&
bt
);
...
...
@@ -895,7 +892,7 @@ ban_render(struct cli *cli, const uint8_t *bs)
const
uint8_t
*
be
;
be
=
bs
+
ban_len
(
bs
);
bs
+=
1
2
;
bs
+=
1
3
;
while
(
bs
<
be
)
{
ban_iter
(
&
bs
,
&
bt
);
switch
(
bt
.
arg1
)
{
...
...
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