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
535fbe74
Commit
535fbe74
authored
Nov 19, 2012
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop the internal ban delimiters in the persistent ban lists, and
reload all the statements in one go.
parent
dbd7ddc0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
36 deletions
+7
-36
storage_persistent.c
bin/varnishd/storage/storage_persistent.c
+7
-36
No files found.
bin/varnishd/storage/storage_persistent.c
View file @
535fbe74
...
...
@@ -72,22 +72,12 @@ static void
smp_appendban
(
struct
smp_sc
*
sc
,
struct
smp_signspace
*
spc
,
uint32_t
len
,
const
uint8_t
*
ban
)
{
uint8_t
*
ptr
,
*
ptr2
;
(
void
)
sc
;
ptr
=
ptr2
=
SIGNSPACE_FRONT
(
spc
);
assert
(
SIGNSPACE_FREE
(
spc
)
>=
4L
+
4
+
len
);
assert
(
SIGNSPACE_FREE
(
spc
)
>=
len
);
memcpy
(
ptr
,
"BAN"
,
4
);
ptr
+=
4
;
vbe32enc
(
ptr
,
len
);
ptr
+=
4
;
memcpy
(
ptr
,
ban
,
len
);
ptr
+=
len
;
smp_append_signspace
(
spc
,
ptr
-
ptr2
);
memcpy
(
SIGNSPACE_FRONT
(
spc
),
ban
,
len
);
smp_append_signspace
(
spc
,
len
);
}
/* Trust that cache_ban.c takes care of locking */
...
...
@@ -120,38 +110,19 @@ static int
smp_open_bans
(
struct
smp_sc
*
sc
,
struct
smp_signspace
*
spc
)
{
uint8_t
*
ptr
,
*
pe
;
uint32_t
length
;
int
i
,
retval
=
0
;
int
i
;
ASSERT_CLI
();
(
void
)
sc
;
i
=
smp_chk_signspace
(
spc
);
if
(
i
)
return
(
i
);
ptr
=
SIGNSPACE_DATA
(
spc
);
pe
=
SIGNSPACE_FRONT
(
spc
);
BAN_Reload
(
ptr
,
pe
-
ptr
);
while
(
ptr
<
pe
)
{
if
(
memcmp
(
ptr
,
"BAN"
,
4
))
{
retval
=
1001
;
break
;
}
ptr
+=
4
;
length
=
vbe32dec
(
ptr
);
ptr
+=
4
;
if
(
ptr
+
length
>
pe
)
{
retval
=
1003
;
break
;
}
BAN_Reload
(
ptr
,
length
);
ptr
+=
length
;
}
assert
(
ptr
<=
pe
);
return
(
retval
);
return
(
0
);
}
/*--------------------------------------------------------------------
...
...
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