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
2e806f08
Commit
2e806f08
authored
May 31, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the VCL_BYTES to be "long long" rather than double.
parent
bd535f51
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
46 deletions
+21
-46
cache_vrt.c
bin/varnishd/cache/cache_vrt.c
+2
-2
storage.h
bin/varnishd/storage/storage.h
+4
-3
storage_malloc.c
bin/varnishd/storage/storage_malloc.c
+3
-2
vrt.h
include/vrt.h
+7
-6
generate.py
lib/libvcc/generate.py
+5
-33
No files found.
bin/varnishd/cache/cache_vrt.c
View file @
2e806f08
...
...
@@ -474,8 +474,8 @@ VRT_ban_string(VRT_CTX, const char *str)
VAV_Free
(
av
);
}
ssize_t
VRT_CacheReqBody
(
VRT_CTX
,
size_t
maxsize
)
VCL_BYTES
VRT_CacheReqBody
(
VRT_CTX
,
VCL_BYTES
maxsize
)
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
...
...
bin/varnishd/storage/storage.h
View file @
2e806f08
...
...
@@ -79,9 +79,10 @@ typedef struct storage *sml_alloc_f(const struct stevedore *, size_t size);
typedef
void
sml_free_f
(
struct
storage
*
);
/* Prototypes for VCL variable responders */
#define VRTSTVTYPE(ct) typedef ct storage_var_##ct(const struct stevedore *);
#define VRTSTVVAR(nm,vt,ct,def) \
typedef ct stv_var_##nm(const struct stevedore *);
#include "tbl/vrt_stv_var.h"
#undef VRTSTV
TYPE
#undef VRTSTV
VAR
/*--------------------------------------------------------------------*/
...
...
@@ -112,7 +113,7 @@ struct stevedore {
/* Only if LRU is used */
struct
lru
*
lru
;
#define VRTSTVVAR(nm, vtype, ctype, dval) st
orage_var_##ctype
*var_##nm;
#define VRTSTVVAR(nm, vtype, ctype, dval) st
v_var_##nm
*var_##nm;
#include "tbl/vrt_stv_var.h"
#undef VRTSTVVAR
...
...
bin/varnishd/storage/storage_malloc.c
View file @
2e806f08
...
...
@@ -38,6 +38,7 @@
#include "storage/storage.h"
#include "storage/storage_simple.h"
#include "vrt.h"
#include "vnum.h"
struct
sma_sc
{
...
...
@@ -147,7 +148,7 @@ sma_free(struct storage *s)
free
(
sma
);
}
static
double
static
VCL_BYTES
__match_proto__
(
stv_var_used_space
)
sma_used_space
(
const
struct
stevedore
*
st
)
{
struct
sma_sc
*
sma_sc
;
...
...
@@ -156,7 +157,7 @@ sma_used_space(const struct stevedore *st)
return
(
sma_sc
->
sma_alloc
);
}
static
double
static
VCL_BYTES
__match_proto__
(
stv_var_free_space
)
sma_free_space
(
const
struct
stevedore
*
st
)
{
struct
sma_sc
*
sma_sc
;
...
...
include/vrt.h
View file @
2e806f08
...
...
@@ -31,8 +31,6 @@
* NB: When this file is changed, lib/libvcc/generate.py *MUST* be rerun.
*/
#include <sys/types.h>
/***********************************************************************
* Major and minor VRT API versions.
*
...
...
@@ -40,6 +38,9 @@
* Whenever something is deleted or changed in a way which is not
* binary/load-time compatible, increment MAJOR version
*
*
* 4.0:
* VCL_BYTES changed to long long
* 3.2:
* vrt_backend grew .proxy_header field
* vrt_ctx grew .sp field.
...
...
@@ -52,9 +53,9 @@
*
*/
#define VRT_MAJOR_VERSION
3
U
#define VRT_MAJOR_VERSION
4
U
#define VRT_MINOR_VERSION
2
U
#define VRT_MINOR_VERSION
0
U
/***********************************************************************/
...
...
@@ -83,7 +84,7 @@ typedef const struct vrt_acl * VCL_ACL;
typedef
const
struct
director
*
VCL_BACKEND
;
typedef
const
struct
vmod_priv
*
VCL_BLOB
;
typedef
unsigned
VCL_BOOL
;
typedef
double
VCL_BYTES
;
typedef
long
long
VCL_BYTES
;
typedef
double
VCL_DURATION
;
typedef
const
char
*
VCL_ENUM
;
typedef
const
struct
gethdr_s
*
VCL_HEADER
;
...
...
@@ -268,7 +269,7 @@ int VRT_acl_match(VRT_CTX, VCL_ACL, VCL_IP);
/* req related */
ssize_t
VRT_CacheReqBody
(
VRT_CTX
,
size_t
maxsize
);
VCL_BYTES
VRT_CacheReqBody
(
VRT_CTX
,
VCL_BYTES
maxsize
);
/* Regexp related */
void
VRT_re_init
(
void
**
,
const
char
*
);
...
...
lib/libvcc/generate.py
View file @
2e806f08
...
...
@@ -812,7 +812,7 @@ vcl_fixed_token(const char *p, const char **q)
continue
if
len
(
j
)
==
2
:
fo
.
write
(
"
\t\t
M2('
%
s',
%
s);
\n
"
%
(
j
[
1
],
emit
[
j
]))
(
j
[
1
],
emit
[
j
]))
elif
len
(
j
)
==
1
:
fo
.
write
(
"
\t\t
M1();
\n
"
)
need_ret
=
False
...
...
@@ -987,8 +987,8 @@ fo.write("#endif\n")
fo
.
write
(
"
\n
#ifdef VCL_MET_MAC
\n
"
)
for
i
in
ll
:
fo
.
write
(
"VCL_MET_MAC(
%
s,
%
s,
%
s,"
%
(
i
[
0
]
.
lower
(),
i
[
0
]
.
upper
(),
i
[
1
]))
fo
.
write
(
"VCL_MET_MAC(
%
s,
%
s,
%
s,"
%
(
i
[
0
]
.
lower
(),
i
[
0
]
.
upper
(),
i
[
1
]))
p
=
" (
\n\t
"
for
j
in
sorted
(
i
[
2
]):
fo
.
write
(
"
%
s(1U << VCL_RET_
%
s)"
%
(
p
,
j
.
upper
()))
...
...
@@ -1035,8 +1035,7 @@ def tbl40(a, b):
fo
.
write
(
"
\n
/* VCL Methods */
\n
"
)
n
=
1
for
i
in
returns
:
fo
.
write
(
tbl40
(
"#define VCL_MET_
%
s"
%
i
[
0
]
.
upper
(),
"(1U <<
%
d)
\n
"
%
n
))
fo
.
write
(
tbl40
(
"#define VCL_MET_
%
s"
%
i
[
0
]
.
upper
(),
"(1U <<
%
d)
\n
"
%
n
))
n
+=
1
fo
.
write
(
"
\n
"
+
tbl40
(
"#define VCL_MET_MAX"
,
"
%
d
\n
"
%
n
))
...
...
@@ -1152,8 +1151,7 @@ def one_var(nm, spec):
else
:
fo
.
write
(
'
\t
"VRT_r_
%
s(ctx)",
\n
'
%
cnam
)
if
nm
==
i
[
0
]:
fh
.
write
(
"VCL_"
+
typ
+
" VRT_r_
%
s(VRT_CTX);
\n
"
%
cnam
)
fh
.
write
(
"VCL_"
+
typ
+
" VRT_r_
%
s(VRT_CTX);
\n
"
%
cnam
)
restrict
(
fo
,
spec
[
2
])
if
len
(
spec
[
3
])
==
0
:
...
...
@@ -1240,38 +1238,12 @@ fo = open(join(buildroot, "include/tbl/vrt_stv_var.h"), "w")
file_header
(
fo
)
fo
.
write
(
"""
#ifndef VRTSTVTYPE
#define VRTSTVTYPE(ct)
#define VRTSTVTYPEX
#endif
#ifndef VRTSTVVAR
#define VRTSTVVAR(nm, vtype, ctype, dval)
#define VRTSTVVARX
#endif
"""
)
x
=
dict
()
for
i
in
stv_variables
:
ct
=
vcltypes
[
i
[
1
]]
if
not
ct
in
x
:
fo
.
write
(
"VRTSTVTYPE("
+
ct
+
")
\n
"
)
x
[
ct
]
=
1
fo
.
write
(
"VRTSTVVAR("
+
i
[
0
]
+
",
\t
"
+
i
[
1
]
+
",
\t
"
)
fo
.
write
(
ct
+
",
\t
"
+
i
[
2
]
+
")"
)
fo
.
write
(
"
\n
"
)
fo
.
write
(
"""
#ifdef VRTSTVTYPEX
#undef VRTSTVTYPEX
#undef VRTSTVTYPE
#endif
#ifdef VRTSTVVARX
#undef VRTSTVVARX
#undef VRTSTVVAR
#endif
"""
)
fo
.
close
()
#######################################################################
...
...
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