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
368197ad
Commit
368197ad
authored
Oct 09, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
And now it is VNUM's turn...
parent
b37c01df
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
21 additions
and
19 deletions
+21
-19
mgt_shmem.c
bin/varnishd/mgt_shmem.c
+3
-2
stevedore_utils.c
bin/varnishd/stevedore_utils.c
+2
-1
storage_file.c
bin/varnishd/storage_file.c
+2
-1
storage_malloc.c
bin/varnishd/storage_malloc.c
+2
-1
storage_umem.c
bin/varnishd/storage_umem.c
+1
-1
Makefile.am
include/Makefile.am
+1
-0
libvarnish.h
include/libvarnish.h
+0
-3
Makefile.am
lib/libvarnish/Makefile.am
+5
-5
vnum.c
lib/libvarnish/vnum.c
+5
-5
No files found.
bin/varnishd/mgt_shmem.c
View file @
368197ad
...
@@ -103,6 +103,7 @@
...
@@ -103,6 +103,7 @@
#include "vmb.h"
#include "vmb.h"
#include "vsm.h"
#include "vsm.h"
#include "vav.h"
#include "vav.h"
#include "vnum.h"
#include "flopen.h"
#include "flopen.h"
#ifndef MAP_HASSEMAPHORE
#ifndef MAP_HASSEMAPHORE
...
@@ -244,7 +245,7 @@ mgt_SHM_Init(const char *l_arg)
...
@@ -244,7 +245,7 @@ mgt_SHM_Init(const char *l_arg)
/* Size of SHMLOG */
/* Size of SHMLOG */
if
(
*
ap
!=
NULL
&&
**
ap
!=
'\0'
)
{
if
(
*
ap
!=
NULL
&&
**
ap
!=
'\0'
)
{
q
=
str
2bytes
(
*
ap
,
&
s1
,
0
);
q
=
VNUM_
2bytes
(
*
ap
,
&
s1
,
0
);
if
(
q
!=
NULL
)
if
(
q
!=
NULL
)
ARGV_ERR
(
"
\t
-l[1] ...: %s
\n
"
,
q
);
ARGV_ERR
(
"
\t
-l[1] ...: %s
\n
"
,
q
);
}
else
{
}
else
{
...
@@ -255,7 +256,7 @@ mgt_SHM_Init(const char *l_arg)
...
@@ -255,7 +256,7 @@ mgt_SHM_Init(const char *l_arg)
/* Size of space for other stuff */
/* Size of space for other stuff */
if
(
*
ap
!=
NULL
&&
**
ap
!=
'\0'
)
{
if
(
*
ap
!=
NULL
&&
**
ap
!=
'\0'
)
{
q
=
str
2bytes
(
*
ap
,
&
s2
,
0
);
q
=
VNUM_
2bytes
(
*
ap
,
&
s2
,
0
);
if
(
q
!=
NULL
)
if
(
q
!=
NULL
)
ARGV_ERR
(
"
\t
-l[2] ...: %s
\n
"
,
q
);
ARGV_ERR
(
"
\t
-l[2] ...: %s
\n
"
,
q
);
}
else
{
}
else
{
...
...
bin/varnishd/stevedore_utils.c
View file @
368197ad
...
@@ -53,6 +53,7 @@
...
@@ -53,6 +53,7 @@
#include "mgt.h"
#include "mgt.h"
#include "stevedore.h"
#include "stevedore.h"
#include "vnum.h"
#ifndef O_LARGEFILE
#ifndef O_LARGEFILE
#define O_LARGEFILE 0
#define O_LARGEFILE 0
...
@@ -197,7 +198,7 @@ STV_FileSize(int fd, const char *size, unsigned *granularity, const char *ctx)
...
@@ -197,7 +198,7 @@ STV_FileSize(int fd, const char *size, unsigned *granularity, const char *ctx)
l
=
st
.
st_size
;
l
=
st
.
st_size
;
}
else
{
}
else
{
AN
(
size
);
AN
(
size
);
q
=
str
2bytes
(
size
,
&
l
,
fssize
);
q
=
VNUM_
2bytes
(
size
,
&
l
,
fssize
);
if
(
q
!=
NULL
)
if
(
q
!=
NULL
)
ARGV_ERR
(
"(%s) size
\"
%s
\"
: %s
\n
"
,
size
,
ctx
,
q
);
ARGV_ERR
(
"(%s) size
\"
%s
\"
: %s
\n
"
,
size
,
ctx
,
q
);
...
...
bin/varnishd/storage_file.c
View file @
368197ad
...
@@ -38,6 +38,7 @@
...
@@ -38,6 +38,7 @@
#include "cache.h"
#include "cache.h"
#include "stevedore.h"
#include "stevedore.h"
#include "vnum.h"
#ifndef MAP_NOCORE
#ifndef MAP_NOCORE
#define MAP_NOCORE 0
/* XXX Linux */
#define MAP_NOCORE 0
/* XXX Linux */
...
@@ -131,7 +132,7 @@ smf_init(struct stevedore *parent, int ac, char * const *av)
...
@@ -131,7 +132,7 @@ smf_init(struct stevedore *parent, int ac, char * const *av)
size
=
av
[
1
];
size
=
av
[
1
];
if
(
ac
>
2
&&
*
av
[
2
]
!=
'\0'
)
{
if
(
ac
>
2
&&
*
av
[
2
]
!=
'\0'
)
{
r
=
str
2bytes
(
av
[
2
],
&
page_size
,
0
);
r
=
VNUM_
2bytes
(
av
[
2
],
&
page_size
,
0
);
if
(
r
!=
NULL
)
if
(
r
!=
NULL
)
ARGV_ERR
(
"(-sfile) granularity
\"
%s
\"
: %s
\n
"
,
av
[
2
],
r
);
ARGV_ERR
(
"(-sfile) granularity
\"
%s
\"
: %s
\n
"
,
av
[
2
],
r
);
}
}
...
...
bin/varnishd/storage_malloc.c
View file @
368197ad
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
#include "cache.h"
#include "cache.h"
#include "stevedore.h"
#include "stevedore.h"
#include "vnum.h"
struct
sma_sc
{
struct
sma_sc
{
unsigned
magic
;
unsigned
magic
;
...
@@ -216,7 +217,7 @@ sma_init(struct stevedore *parent, int ac, char * const *av)
...
@@ -216,7 +217,7 @@ sma_init(struct stevedore *parent, int ac, char * const *av)
if
(
ac
==
0
||
*
av
[
0
]
==
'\0'
)
if
(
ac
==
0
||
*
av
[
0
]
==
'\0'
)
return
;
return
;
e
=
str
2bytes
(
av
[
0
],
&
u
,
0
);
e
=
VNUM_
2bytes
(
av
[
0
],
&
u
,
0
);
if
(
e
!=
NULL
)
if
(
e
!=
NULL
)
ARGV_ERR
(
"(-smalloc) size
\"
%s
\"
: %s
\n
"
,
av
[
0
],
e
);
ARGV_ERR
(
"(-smalloc) size
\"
%s
\"
: %s
\n
"
,
av
[
0
],
e
);
if
((
u
!=
(
uintmax_t
)(
size_t
)
u
))
if
((
u
!=
(
uintmax_t
)(
size_t
)
u
))
...
...
bin/varnishd/storage_umem.c
View file @
368197ad
...
@@ -140,7 +140,7 @@ smu_init(struct stevedore *parent, int ac, char * const *av)
...
@@ -140,7 +140,7 @@ smu_init(struct stevedore *parent, int ac, char * const *av)
if
(
ac
==
0
||
*
av
[
0
]
==
'\0'
)
if
(
ac
==
0
||
*
av
[
0
]
==
'\0'
)
return
;
return
;
e
=
str
2bytes
(
av
[
0
],
&
u
,
0
);
e
=
VNUM_
2bytes
(
av
[
0
],
&
u
,
0
);
if
(
e
!=
NULL
)
if
(
e
!=
NULL
)
ARGV_ERR
(
"(-sumem) size
\"
%s
\"
: %s
\n
"
,
av
[
0
],
e
);
ARGV_ERR
(
"(-sumem) size
\"
%s
\"
: %s
\n
"
,
av
[
0
],
e
);
if
((
u
!=
(
uintmax_t
)(
size_t
)
u
))
if
((
u
!=
(
uintmax_t
)(
size_t
)
u
))
...
...
include/Makefile.am
View file @
368197ad
...
@@ -48,6 +48,7 @@ nobase_noinst_HEADERS = \
...
@@ -48,6 +48,7 @@ nobase_noinst_HEADERS = \
vlu.h
\
vlu.h
\
vmb.h
\
vmb.h
\
vmod_abi.h
\
vmod_abi.h
\
vnum.h
\
vpf.h
\
vpf.h
\
vqueue.h
\
vqueue.h
\
vre.h
\
vre.h
\
...
...
include/libvarnish.h
View file @
368197ad
...
@@ -38,9 +38,6 @@
...
@@ -38,9 +38,6 @@
struct
vsb
;
struct
vsb
;
/* from libvarnish/num.c */
const
char
*
str2bytes
(
const
char
*
p
,
uintmax_t
*
r
,
uintmax_t
rel
);
/* from libvarnish/version.c */
/* from libvarnish/version.c */
void
VCS_Message
(
const
char
*
);
void
VCS_Message
(
const
char
*
);
...
...
lib/libvarnish/Makefile.am
View file @
368197ad
...
@@ -13,7 +13,7 @@ libvarnish_la_SOURCES = \
...
@@ -13,7 +13,7 @@ libvarnish_la_SOURCES = \
cli_common.c
\
cli_common.c
\
cli_serve.c
\
cli_serve.c
\
flopen.c
\
flopen.c
\
num.c
\
v
num.c
\
vtim.c
\
vtim.c
\
vtcp.c
\
vtcp.c
\
vct.c
\
vct.c
\
...
@@ -33,13 +33,13 @@ libvarnish_la_CFLAGS = -DVARNISH_STATE_DIR='"${VARNISH_STATE_DIR}"'
...
@@ -33,13 +33,13 @@ libvarnish_la_CFLAGS = -DVARNISH_STATE_DIR='"${VARNISH_STATE_DIR}"'
libvarnish_la_LIBADD
=
${
RT_LIBS
}
${
NET_LIBS
}
${
LIBM
}
@PCRE_LIBS@
libvarnish_la_LIBADD
=
${
RT_LIBS
}
${
NET_LIBS
}
${
LIBM
}
@PCRE_LIBS@
if
ENABLE_TESTS
if
ENABLE_TESTS
TESTS
=
num_c_test
TESTS
=
v
num_c_test
noinst_PROGRAMS
=
${
TESTS
}
noinst_PROGRAMS
=
${
TESTS
}
num_c_test_SOURCES
=
num.c
vnum_c_test_SOURCES
=
v
num.c
num_c_test_CFLAGS
=
-DNUM_C_TEST
-include
config.h
v
num_c_test_CFLAGS
=
-DNUM_C_TEST
-include
config.h
num_c_test_LDADD
=
${
LIBM
}
v
num_c_test_LDADD
=
${
LIBM
}
test
:
${TESTS}
test
:
${TESTS}
@
for
test
in
${
TESTS
}
;
do
./
$$
{
test
}
;
done
@
for
test
in
${
TESTS
}
;
do
./
$$
{
test
}
;
done
...
...
lib/libvarnish/num.c
→
lib/libvarnish/
v
num.c
View file @
368197ad
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
#include <stdlib.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdint.h>
#include "
libvarnish
.h"
#include "
vnum
.h"
static
const
char
err_miss_num
[]
=
"Missing number"
;
static
const
char
err_miss_num
[]
=
"Missing number"
;
static
const
char
err_invalid_num
[]
=
"Invalid number"
;
static
const
char
err_invalid_num
[]
=
"Invalid number"
;
...
@@ -43,7 +43,7 @@ static const char err_abs_req[] = "Absolute number required";
...
@@ -43,7 +43,7 @@ static const char err_abs_req[] = "Absolute number required";
static
const
char
err_invalid_suff
[]
=
"Invalid suffix"
;
static
const
char
err_invalid_suff
[]
=
"Invalid suffix"
;
const
char
*
const
char
*
str
2bytes
(
const
char
*
p
,
uintmax_t
*
r
,
uintmax_t
rel
)
VNUM_
2bytes
(
const
char
*
p
,
uintmax_t
*
r
,
uintmax_t
rel
)
{
{
double
fval
;
double
fval
;
char
*
end
;
char
*
end
;
...
@@ -178,13 +178,13 @@ main(int argc, char *argv[])
...
@@ -178,13 +178,13 @@ main(int argc, char *argv[])
(
void
)
argc
;
(
void
)
argc
;
for
(
ec
=
0
,
tc
=
test_cases
;
tc
->
str
;
++
tc
)
{
for
(
ec
=
0
,
tc
=
test_cases
;
tc
->
str
;
++
tc
)
{
e
=
str
2bytes
(
tc
->
str
,
&
val
,
tc
->
rel
);
e
=
VNUM_
2bytes
(
tc
->
str
,
&
val
,
tc
->
rel
);
if
(
e
!=
tc
->
err
)
{
if
(
e
!=
tc
->
err
)
{
printf
(
"%s:
str
2bytes(
\"
%s
\"
, %ju) (%s) != (%s)
\n
"
,
printf
(
"%s:
VNUM_
2bytes(
\"
%s
\"
, %ju) (%s) != (%s)
\n
"
,
*
argv
,
tc
->
str
,
tc
->
rel
,
tc
->
err
,
e
);
*
argv
,
tc
->
str
,
tc
->
rel
,
tc
->
err
,
e
);
++
ec
;
++
ec
;
}
else
if
(
e
==
NULL
&&
val
!=
tc
->
val
)
{
}
else
if
(
e
==
NULL
&&
val
!=
tc
->
val
)
{
printf
(
"%s:
str
2bytes(
\"
%s
\"
, %ju) %ju != %ju (%s)
\n
"
,
printf
(
"%s:
VNUM_
2bytes(
\"
%s
\"
, %ju) %ju != %ju (%s)
\n
"
,
*
argv
,
tc
->
str
,
tc
->
rel
,
val
,
tc
->
val
,
e
);
*
argv
,
tc
->
str
,
tc
->
rel
,
val
,
tc
->
val
,
e
);
++
ec
;
++
ec
;
}
}
...
...
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