Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-vslp
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
libvmod-vslp
Commits
bd7505c0
Commit
bd7505c0
authored
Sep 12, 2016
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
assert that VCL_INT is sufficiently large
parent
d9060fc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
vmod_shard.c
src/vmod_shard.c
+12
-3
No files found.
src/vmod_shard.c
View file @
bd7505c0
...
...
@@ -58,9 +58,9 @@ struct vmod_shard_shard {
};
/*
* our key is a uint32_t, but VCL_INT is a (signed) long
and we don't have a
*
VCL_UINT - so we cast back and forth assuming that compilers agree that using
*
a longer machine type as a container is safe
* our key is a uint32_t, but VCL_INT is a (signed) long
. We cast back and
*
forth, asserting in vmod_shard__init() that VCL_INT is a large enough
*
container
*/
VCL_INT
__match_proto__
(
td_shard_key
)
vmod_key
(
VRT_CTX
,
VCL_STRING
s
,
VCL_ENUM
alg_s
)
...
...
@@ -78,6 +78,15 @@ vmod_shard__init(VRT_CTX, struct vmod_shard_shard **vshardp,
const
char
*
vcl_name
)
{
struct
vmod_shard_shard
*
vshard
;
VCL_INT
t1
;
uint32_t
t2a
,
t2b
;
/* see vmod_key comment */
assert
(
sizeof
(
VCL_INT
)
>=
sizeof
(
uint32_t
));
t2a
=
UINT32_MAX
;
t1
=
(
VCL_INT
)
t2a
;
t2b
=
(
uint32_t
)
t1
;
assert
(
t2a
==
t2b
);
(
void
)
ctx
;
AN
(
vshardp
);
...
...
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