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
5dd5f9dd
Commit
5dd5f9dd
authored
Jan 19, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Miniobj-ify the compiled backend and probe structs
parent
93b6da19
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
vrt.h
include/vrt.h
+12
-8
vcc_backend.c
lib/libvcc/vcc_backend.c
+2
-0
No files found.
include/vrt.h
View file @
5dd5f9dd
...
@@ -140,6 +140,8 @@ extern const void * const vrt_magic_string_end;
...
@@ -140,6 +140,8 @@ extern const void * const vrt_magic_string_end;
extern
const
void
*
const
vrt_magic_string_unset
;
extern
const
void
*
const
vrt_magic_string_unset
;
struct
vrt_backend_probe
{
struct
vrt_backend_probe
{
unsigned
magic
;
#define VRT_BACKEND_PROBE_MAGIC 0x84998490
const
char
*
url
;
const
char
*
url
;
const
char
*
request
;
const
char
*
request
;
double
timeout
;
double
timeout
;
...
@@ -154,6 +156,8 @@ struct vrt_backend_probe {
...
@@ -154,6 +156,8 @@ struct vrt_backend_probe {
* A backend is a host+port somewhere on the network
* A backend is a host+port somewhere on the network
*/
*/
struct
vrt_backend
{
struct
vrt_backend
{
unsigned
magic
;
#define VRT_BACKEND_MAGIC 0x4799ce6b
const
char
*
vcl_name
;
const
char
*
vcl_name
;
const
char
*
ipv4_addr
;
const
char
*
ipv4_addr
;
const
char
*
ipv6_addr
;
const
char
*
ipv6_addr
;
...
...
lib/libvcc/vcc_backend.c
View file @
5dd5f9dd
...
@@ -126,6 +126,7 @@ vcc_ParseProbeSpec(struct vcc *tl)
...
@@ -126,6 +126,7 @@ vcc_ParseProbeSpec(struct vcc *tl)
status
=
0
;
status
=
0
;
Fh
(
tl
,
0
,
"static const struct vrt_backend_probe vgc_probe__%d = {
\n
"
,
Fh
(
tl
,
0
,
"static const struct vrt_backend_probe vgc_probe__%d = {
\n
"
,
tl
->
nprobe
++
);
tl
->
nprobe
++
);
Fh
(
tl
,
0
,
"
\t
.magic = VRT_BACKEND_PROBE_MAGIC,
\n
"
);
while
(
tl
->
t
->
tok
!=
'}'
)
{
while
(
tl
->
t
->
tok
!=
'}'
)
{
vcc_IsField
(
tl
,
&
t_field
,
fs
);
vcc_IsField
(
tl
,
&
t_field
,
fs
);
...
@@ -305,6 +306,7 @@ vcc_ParseHostDef(struct vcc *tl, const struct token *t_be)
...
@@ -305,6 +306,7 @@ vcc_ParseHostDef(struct vcc *tl, const struct token *t_be)
Fb
(
tl
,
0
,
"
\n
static const struct vrt_backend vgc_dir_priv_%s = {
\n
"
,
Fb
(
tl
,
0
,
"
\n
static const struct vrt_backend vgc_dir_priv_%s = {
\n
"
,
vgcname
);
vgcname
);
Fb
(
tl
,
0
,
"
\t
.magic = VRT_BACKEND_MAGIC,
\n
"
);
Fb
(
tl
,
0
,
"
\t
.vcl_name =
\"
%.*s"
,
PF
(
t_be
));
Fb
(
tl
,
0
,
"
\t
.vcl_name =
\"
%.*s"
,
PF
(
t_be
));
Fb
(
tl
,
0
,
"
\"
,
\n
"
);
Fb
(
tl
,
0
,
"
\"
,
\n
"
);
...
...
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