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
0a712d95
Commit
0a712d95
authored
Mar 12, 2013
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure object destructors are called as the first thing in the
VCL::fini cleanup
parent
a1ed465f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
vcc_action.c
lib/libvcl/vcc_action.c
+1
-1
vcc_compile.c
lib/libvcl/vcc_compile.c
+20
-0
vcc_compile.h
lib/libvcl/vcc_compile.h
+3
-0
No files found.
lib/libvcl/vcc_action.c
View file @
0a712d95
...
...
@@ -222,7 +222,7 @@ parse_new(struct vcc *tl)
bprintf
(
buf1
,
", &%s,
\"
%s
\"
"
,
sy1
->
name
,
sy1
->
name
);
vcc_Eval_Func
(
tl
,
s_init
,
buf1
,
"ASDF"
,
s_init
+
strlen
(
s_init
)
+
1
);
F
f
(
tl
,
0
,
"
\t
%s((struct req*)0, &%s);
\n
"
,
s_fini
,
sy1
->
name
);
F
d
(
tl
,
0
,
"
\t
%s((struct req*)0, &%s);
\n
"
,
s_fini
,
sy1
->
name
);
ExpectErr
(
tl
,
';'
);
bprintf
(
buf1
,
", %s"
,
sy1
->
name
);
...
...
lib/libvcl/vcc_compile.c
View file @
0a712d95
...
...
@@ -189,6 +189,19 @@ Fi(const struct vcc *tl, int indent, const char *fmt, ...)
va_end
(
ap
);
}
void
Fd
(
const
struct
vcc
*
tl
,
int
indent
,
const
char
*
fmt
,
...)
{
va_list
ap
;
if
(
indent
)
VSB_printf
(
tl
->
fd
,
"%*.*s"
,
tl
->
findent
,
tl
->
findent
,
""
);
va_start
(
ap
,
fmt
);
VSB_vprintf
(
tl
->
fd
,
fmt
,
ap
);
va_end
(
ap
);
}
void
Ff
(
const
struct
vcc
*
tl
,
int
indent
,
const
char
*
fmt
,
...)
{
...
...
@@ -316,6 +329,9 @@ EmitFiniFunc(const struct vcc *tl)
Fc
(
tl
,
0
,
"
\n
static void
\n
VGC_Fini(struct cli *cli)
\n
{
\n\n
"
);
AZ
(
VSB_finish
(
tl
->
fd
));
VSB_cat
(
tl
->
fc
,
VSB_data
(
tl
->
fd
));
/*
* We do this here, so we are sure they happen before any
* per-vcl vmod_privs get cleaned.
...
...
@@ -517,6 +533,10 @@ vcc_NewVcc(const struct vcc *tl0)
tl
->
fi
=
VSB_new_auto
();
assert
(
tl
->
fi
!=
NULL
);
/* Destroy Objects */
tl
->
fd
=
VSB_new_auto
();
assert
(
tl
->
fd
!=
NULL
);
/* Finish C code */
tl
->
ff
=
VSB_new_auto
();
assert
(
tl
->
ff
!=
NULL
);
...
...
lib/libvcl/vcc_compile.h
View file @
0a712d95
...
...
@@ -170,6 +170,7 @@ struct vcc {
struct
vsb
*
fc
;
/* C-code */
struct
vsb
*
fh
;
/* H-code (before C-code) */
struct
vsb
*
fi
;
/* Init func code */
struct
vsb
*
fd
;
/* Object destructors */
struct
vsb
*
ff
;
/* Finish func code */
struct
vsb
*
fb
;
/* Body of current sub
* NULL otherwise
...
...
@@ -258,6 +259,8 @@ void Fi(const struct vcc *tl, int indent, const char *fmt, ...)
__printflike
(
3
,
4
);
void
Ff
(
const
struct
vcc
*
tl
,
int
indent
,
const
char
*
fmt
,
...)
__printflike
(
3
,
4
);
void
Fd
(
const
struct
vcc
*
tl
,
int
indent
,
const
char
*
fmt
,
...)
__printflike
(
3
,
4
);
void
EncToken
(
struct
vsb
*
sb
,
const
struct
token
*
t
);
int
IsMethod
(
const
struct
token
*
t
);
void
*
TlAlloc
(
struct
vcc
*
tl
,
unsigned
len
);
...
...
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