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
73e85b57
Commit
73e85b57
authored
Mar 06, 2018
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Be agnostic about size of VCL_INT and VCL_BYTES
parent
a60d8d95
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
12 deletions
+14
-12
cache_vrt.c
bin/varnishd/cache/cache_vrt.c
+3
-3
vmod_blob.c
lib/libvmod_blob/vmod_blob.c
+4
-3
shard_cfg.c
lib/libvmod_directors/shard_cfg.c
+2
-2
vmod_shard.c
lib/libvmod_directors/vmod_shard.c
+5
-4
No files found.
bin/varnishd/cache/cache_vrt.c
View file @
73e85b57
...
...
@@ -462,11 +462,11 @@ VRT_IP_string(VRT_CTX, VCL_IP ip)
}
VCL_STRING
v_matchproto_
()
VRT_INT_string
(
VRT_CTX
,
long
num
)
VRT_INT_string
(
VRT_CTX
,
VCL_INT
num
)
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
return
(
WS_Printf
(
ctx
->
ws
,
"%
ld"
,
num
));
return
(
WS_Printf
(
ctx
->
ws
,
"%
jd"
,
(
intmax_t
)
num
));
}
VCL_STRING
v_matchproto_
()
...
...
@@ -499,7 +499,7 @@ VRT_BACKEND_string(VCL_BACKEND d)
}
VCL_STRING
v_matchproto_
()
VRT_BOOL_string
(
unsigned
val
)
VRT_BOOL_string
(
VCL_BOOL
val
)
{
return
(
val
?
"true"
:
"false"
);
...
...
lib/libvmod_blob/vmod_blob.c
View file @
73e85b57
...
...
@@ -581,8 +581,9 @@ vmod_sub(VRT_CTX, VCL_BLOB b, VCL_BYTES n, VCL_BYTES off)
}
assert
(
b
->
len
>=
0
);
if
(
off
+
n
>
b
->
len
)
{
VERR
(
ctx
,
"size %lld from offset %lld requires more bytes than "
"blob length %d in blob.sub()"
,
n
,
off
,
b
->
len
);
VERR
(
ctx
,
"size %jd from offset %jd requires more bytes than "
"blob length %d in blob.sub()"
,
(
intmax_t
)
n
,
(
intmax_t
)
off
,
b
->
len
);
return
NULL
;
}
...
...
@@ -595,7 +596,7 @@ vmod_sub(VRT_CTX, VCL_BLOB b, VCL_BYTES n, VCL_BYTES off)
return
NULL
;
}
if
((
sub
->
priv
=
WS_Alloc
(
ctx
->
ws
,
n
))
==
NULL
)
{
VERRNOMEM
(
ctx
,
"Allocating %
lld bytes in blob.sub()"
,
n
);
VERRNOMEM
(
ctx
,
"Allocating %
jd bytes in blob.sub()"
,
(
intmax_t
)
n
);
WS_Reset
(
ctx
->
ws
,
snap
);
return
NULL
;
}
...
...
lib/libvmod_directors/shard_cfg.c
View file @
73e85b57
...
...
@@ -278,9 +278,9 @@ shardcfg_hashcircle(struct sharddir *shardd, VCL_INT replicas)
for
(
i
=
0
;
i
<
shardd
->
n_backend
;
i
++
)
for
(
j
=
0
;
j
<
replicas
;
j
++
)
SHDBG
(
SHDBG_CIRCLE
,
shardd
,
"hashcircle[%5
l
d] = "
"hashcircle[%5
j
d] = "
"{point = %8x, host = %2u}
\n
"
,
i
*
replicas
+
j
,
(
intmax_t
)(
i
*
replicas
+
j
)
,
shardd
->
hashcircle
[
i
*
replicas
+
j
].
point
,
shardd
->
hashcircle
[
i
*
replicas
+
j
].
host
);
}
...
...
lib/libvmod_directors/vmod_shard.c
View file @
73e85b57
...
...
@@ -506,8 +506,9 @@ shard_param_args(VRT_CTX,
}
if
(
key_int
<
0
||
key_int
>
UINT32_MAX
)
{
VRT_fail
(
ctx
,
"%s %s: "
"invalid key argument %ld with by=%s"
,
who
,
p
->
vcl_name
,
key_int
,
by_s
);
"invalid key argument %jd with by=%s"
,
who
,
p
->
vcl_name
,
(
intmax_t
)
key_int
,
by_s
);
return
(
NULL
);
}
assert
(
key_int
>=
0
);
...
...
@@ -561,8 +562,8 @@ shard_param_args(VRT_CTX,
if
(
args
&
arg_alt
)
{
if
(
alt
<
0
)
{
VRT_fail
(
ctx
,
"%s %s: "
"invalid alt argument %
l
d"
,
who
,
p
->
vcl_name
,
alt
);
"invalid alt argument %
j
d"
,
who
,
p
->
vcl_name
,
(
intmax_t
)
alt
);
return
(
NULL
);
}
p
->
alt
=
alt
;
...
...
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