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
92d48483
Commit
92d48483
authored
Aug 18, 2017
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plug more insignificant leaks
Reported by LSAN.
parent
3d6f0daf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
vtc_process.c
bin/varnishtest/vtc_process.c
+1
-1
vtc_varnish.c
bin/varnishtest/vtc_varnish.c
+8
-6
No files found.
bin/varnishtest/vtc_process.c
View file @
92d48483
...
@@ -176,10 +176,10 @@ process_thread(void *priv)
...
@@ -176,10 +176,10 @@ process_thread(void *priv)
vlu
=
VLU_New
(
p
,
process_vlu_func
,
1024
);
vlu
=
VLU_New
(
p
,
process_vlu_func
,
1024
);
while
(
!
VLU_Fd
(
p
->
fd_from
,
vlu
))
while
(
!
VLU_Fd
(
p
->
fd_from
,
vlu
))
continue
;
continue
;
VLU_Destroy
(
vlu
);
}
}
r
=
wait4
(
p
->
pid
,
&
p
->
status
,
0
,
&
ru
);
r
=
wait4
(
p
->
pid
,
&
p
->
status
,
0
,
&
ru
);
AZ
(
pthread_mutex_lock
(
&
p
->
mtx
));
AZ
(
pthread_mutex_lock
(
&
p
->
mtx
));
if
(
p
->
fd_to
>=
0
)
if
(
p
->
fd_to
>=
0
)
...
...
bin/varnishtest/vtc_varnish.c
View file @
92d48483
...
@@ -590,6 +590,7 @@ varnish_start(struct varnish *v)
...
@@ -590,6 +590,7 @@ varnish_start(struct varnish *v)
macro_def
(
v
->
vl
,
v
->
name
,
"addr"
,
"%s"
,
h
);
macro_def
(
v
->
vl
,
v
->
name
,
"addr"
,
"%s"
,
h
);
macro_def
(
v
->
vl
,
v
->
name
,
"port"
,
"%s"
,
p
);
macro_def
(
v
->
vl
,
v
->
name
,
"port"
,
"%s"
,
p
);
macro_def
(
v
->
vl
,
v
->
name
,
"sock"
,
"%s %s"
,
h
,
p
);
macro_def
(
v
->
vl
,
v
->
name
,
"sock"
,
"%s %s"
,
h
,
p
);
free
(
resp
);
/* Wait for vsl logging to get underway */
/* Wait for vsl logging to get underway */
while
(
v
->
vsl_rec
==
0
)
while
(
v
->
vsl_rec
==
0
)
VTIM_sleep
(.
1
);
VTIM_sleep
(.
1
);
...
@@ -602,7 +603,7 @@ varnish_start(struct varnish *v)
...
@@ -602,7 +603,7 @@ varnish_start(struct varnish *v)
static
void
static
void
varnish_stop
(
struct
varnish
*
v
)
varnish_stop
(
struct
varnish
*
v
)
{
{
char
*
r
;
char
*
r
=
NULL
;
if
(
v
->
cli_fd
<
0
)
if
(
v
->
cli_fd
<
0
)
varnish_launch
(
v
);
varnish_launch
(
v
);
...
@@ -611,12 +612,14 @@ varnish_stop(struct varnish *v)
...
@@ -611,12 +612,14 @@ varnish_stop(struct varnish *v)
vtc_log
(
v
->
vl
,
2
,
"Stop"
);
vtc_log
(
v
->
vl
,
2
,
"Stop"
);
(
void
)
varnish_ask_cli
(
v
,
"stop"
,
NULL
);
(
void
)
varnish_ask_cli
(
v
,
"stop"
,
NULL
);
while
(
1
)
{
while
(
1
)
{
r
=
NULL
;
(
void
)
varnish_ask_cli
(
v
,
"status"
,
&
r
);
(
void
)
varnish_ask_cli
(
v
,
"status"
,
&
r
);
AN
(
r
);
AN
(
r
);
if
(
!
strcmp
(
r
,
"Child in state stopped"
))
if
(
!
strcmp
(
r
,
"Child in state stopped"
))
{
free
(
r
);
break
;
break
;
}
free
(
r
);
free
(
r
);
r
=
NULL
;
(
void
)
sleep
(
1
);
(
void
)
sleep
(
1
);
/* XXX: should fail eventually */
/* XXX: should fail eventually */
}
}
...
@@ -672,8 +675,6 @@ varnish_cleanup(struct varnish *v)
...
@@ -672,8 +675,6 @@ varnish_cleanup(struct varnish *v)
static
void
static
void
varnish_wait
(
struct
varnish
*
v
)
varnish_wait
(
struct
varnish
*
v
)
{
{
char
*
resp
;
if
(
v
->
cli_fd
<
0
)
if
(
v
->
cli_fd
<
0
)
return
;
return
;
...
@@ -681,7 +682,7 @@ varnish_wait(struct varnish *v)
...
@@ -681,7 +682,7 @@ varnish_wait(struct varnish *v)
if
(
!
vtc_error
)
{
if
(
!
vtc_error
)
{
/* Do a backend.list to log if child is still running */
/* Do a backend.list to log if child is still running */
(
void
)
varnish_ask_cli
(
v
,
"backend.list"
,
&
resp
);
(
void
)
varnish_ask_cli
(
v
,
"backend.list"
,
NULL
);
}
}
/* Then stop it */
/* Then stop it */
...
@@ -726,6 +727,7 @@ varnish_cli(struct varnish *v, const char *cli, unsigned exp, const char *re)
...
@@ -726,6 +727,7 @@ varnish_cli(struct varnish *v, const char *cli, unsigned exp, const char *re)
vtc_fatal
(
v
->
vl
,
"Expect failed (%d)"
,
err
);
vtc_fatal
(
v
->
vl
,
"Expect failed (%d)"
,
err
);
VRE_free
(
&
vre
);
VRE_free
(
&
vre
);
}
}
free
(
resp
);
}
}
/**********************************************************************
/**********************************************************************
...
...
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