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
091e29ba
Commit
091e29ba
authored
Apr 14, 2018
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plug a few more leaks
parent
49f3387c
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
36 additions
and
14 deletions
+36
-14
vtc.h
bin/varnishtest/vtc.h
+1
-1
vtc_barrier.c
bin/varnishtest/vtc_barrier.c
+2
-2
vtc_client.c
bin/varnishtest/vtc_client.c
+2
-0
vtc_http.c
bin/varnishtest/vtc_http.c
+17
-8
vtc_http2.c
bin/varnishtest/vtc_http2.c
+1
-0
vtc_log.c
bin/varnishtest/vtc_log.c
+2
-1
vtc_logexp.c
bin/varnishtest/vtc_logexp.c
+1
-0
vtc_main.c
bin/varnishtest/vtc_main.c
+3
-1
vtc_server.c
bin/varnishtest/vtc_server.c
+7
-1
No files found.
bin/varnishtest/vtc.h
View file @
091e29ba
...
...
@@ -96,7 +96,7 @@ void cmd_server_gen_haproxy_conf(struct vsb *vsb);
void
vtc_loginit
(
char
*
buf
,
unsigned
buflen
);
struct
vtclog
*
vtc_logopen
(
const
char
*
id
);
void
vtc_logclose
(
struct
vtclog
*
vl
);
void
vtc_logclose
(
void
*
arg
);
void
vtc_log
(
struct
vtclog
*
vl
,
int
lvl
,
const
char
*
fmt
,
...)
v_printflike_
(
3
,
4
);
void
vtc_fatal
(
struct
vtclog
*
vl
,
const
char
*
,
...)
...
...
bin/varnishtest/vtc_barrier.c
View file @
091e29ba
...
...
@@ -137,7 +137,7 @@ barrier_sock_thread(void *priv)
AZ
(
pthread_mutex_lock
(
&
b
->
mtx
));
vl
=
vtc_logopen
(
b
->
name
);
AN
(
vl
);
pthread_cleanup_push
(
vtc_logclose
,
vl
);
sock
=
VTCP_listen_on
(
"127.0.0.1:0"
,
NULL
,
b
->
expected
,
&
err
);
if
(
sock
<
0
)
{
...
...
@@ -219,7 +219,7 @@ barrier_sock_thread(void *priv)
macro_undef
(
vl
,
b
->
name
,
"sock"
);
closefd
(
&
sock
);
free
(
conns
);
pthread_cleanup_pop
(
1
);
return
(
NULL
);
}
...
...
bin/varnishtest/vtc_client.c
View file @
091e29ba
...
...
@@ -207,6 +207,7 @@ client_thread(void *priv)
AN
(
*
c
->
connect
);
vl
=
vtc_logopen
(
c
->
name
);
pthread_cleanup_push
(
vtc_logclose
,
vl
);
vsb
=
macro_expand
(
vl
,
c
->
connect
);
AN
(
vsb
);
...
...
@@ -236,6 +237,7 @@ client_thread(void *priv)
}
vtc_log
(
vl
,
2
,
"Ending"
);
VSB_destroy
(
&
vsb
);
pthread_cleanup_pop
(
1
);
return
(
NULL
);
}
...
...
bin/varnishtest/vtc_http.c
View file @
091e29ba
...
...
@@ -1865,6 +1865,21 @@ const struct cmds http_cmds[] = {
{
NULL
,
NULL
}
};
static
void
http_process_cleanup
(
void
*
arg
)
{
struct
http
*
hp
=
arg
;
if
(
hp
->
h2
)
stop_h2
(
hp
);
VSB_destroy
(
&
hp
->
vsb
);
free
(
hp
->
rxbuf
);
free
(
hp
->
rem_ip
);
free
(
hp
->
rem_port
);
free
(
hp
->
rem_path
);
FREE_OBJ
(
hp
);
}
int
http_process
(
struct
vtclog
*
vl
,
const
char
*
spec
,
int
sock
,
int
*
sfd
,
const
char
*
addr
)
...
...
@@ -1906,16 +1921,10 @@ http_process(struct vtclog *vl, const char *spec, int sock, int *sfd,
strcpy
(
hp
->
rem_port
,
"0"
);
hp
->
rem_path
=
strdup
(
addr
);
}
pthread_cleanup_push
(
http_process_cleanup
,
hp
);
parse_string
(
spec
,
http_cmds
,
hp
,
vl
);
if
(
hp
->
h2
)
stop_h2
(
hp
);
retval
=
hp
->
fd
;
VSB_destroy
(
&
hp
->
vsb
);
free
(
hp
->
rxbuf
);
free
(
hp
->
rem_ip
);
free
(
hp
->
rem_port
);
free
(
hp
->
rem_path
);
FREE_OBJ
(
hp
);
pthread_cleanup_pop
(
1
);
return
(
retval
);
}
...
...
bin/varnishtest/vtc_http2.c
View file @
091e29ba
...
...
@@ -2541,6 +2541,7 @@ static void
stream_delete
(
struct
stream
*
s
)
{
CHECK_OBJ_NOTNULL
(
s
,
STREAM_MAGIC
);
free
(
s
->
body
);
free
(
s
->
spec
);
free
(
s
->
name
);
FREE_OBJ
(
s
);
...
...
bin/varnishtest/vtc_log.c
View file @
091e29ba
...
...
@@ -90,8 +90,9 @@ vtc_logopen(const char *id)
}
void
vtc_logclose
(
struct
vtclog
*
vl
)
vtc_logclose
(
void
*
arg
)
{
struct
vtclog
*
vl
=
arg
;
CHECK_OBJ_NOTNULL
(
vl
,
VTCLOG_MAGIC
);
if
(
pthread_getspecific
(
log_key
)
==
vl
)
...
...
bin/varnishtest/vtc_logexp.c
View file @
091e29ba
...
...
@@ -194,6 +194,7 @@ logexp_delete(struct logexp *le)
free
(
le
->
vname
);
free
(
le
->
query
);
VSM_Destroy
(
&
le
->
vsm
);
vtc_logclose
(
le
->
vl
);
FREE_OBJ
(
le
);
}
...
...
bin/varnishtest/vtc_main.c
View file @
091e29ba
...
...
@@ -240,8 +240,10 @@ tst_cb(const struct vev *ve, int what)
jp
->
tst
->
filename
,
ecode
?
"skipped"
:
"passed"
,
t
);
}
if
(
jp
->
evt
!=
NULL
)
if
(
jp
->
evt
!=
NULL
)
{
VEV_Stop
(
vb
,
jp
->
evt
);
free
(
jp
->
evt
);
}
FREE_OBJ
(
jp
);
return
(
1
);
...
...
bin/varnishtest/vtc_server.c
View file @
091e29ba
...
...
@@ -232,6 +232,7 @@ server_thread(void *priv)
assert
(
s
->
sock
>=
0
);
vl
=
vtc_logopen
(
s
->
name
);
pthread_cleanup_push
(
vtc_logclose
,
vl
);
vtc_log
(
vl
,
2
,
"Started on %s"
,
s
->
listen
);
for
(
i
=
0
;
i
<
s
->
repeat
;
i
++
)
{
...
...
@@ -255,6 +256,7 @@ server_thread(void *priv)
VTCP_close
(
&
fd
);
}
vtc_log
(
vl
,
2
,
"Ending"
);
pthread_cleanup_pop
(
1
);
return
(
NULL
);
}
...
...
@@ -288,6 +290,7 @@ server_dispatch_wrk(void *priv)
assert
(
s
->
sock
<
0
);
vl
=
vtc_logopen
(
s
->
name
);
pthread_cleanup_push
(
vtc_logclose
,
vl
);
fd
=
s
->
fd
;
...
...
@@ -299,6 +302,7 @@ server_dispatch_wrk(void *priv)
vtc_fatal
(
vl
,
"Shutdown failed: %s"
,
strerror
(
errno
));
VTCP_close
(
&
s
->
fd
);
vtc_log
(
vl
,
2
,
"Ending"
);
pthread_cleanup_pop
(
1
);
return
(
NULL
);
}
...
...
@@ -317,7 +321,8 @@ server_dispatch_thread(void *priv)
assert
(
s
->
sock
>=
0
);
vl
=
vtc_logopen
(
s
->
name
);
AN
(
vl
);
pthread_cleanup_push
(
vtc_logclose
,
vl
);
vtc_log
(
vl
,
2
,
"Dispatch started on %s"
,
s
->
listen
);
while
(
1
)
{
...
...
@@ -335,6 +340,7 @@ server_dispatch_thread(void *priv)
s2
->
run
=
1
;
AZ
(
pthread_create
(
&
s2
->
tp
,
NULL
,
server_dispatch_wrk
,
s2
));
}
pthread_cleanup_pop
(
1
);
NEEDLESS
(
return
(
NULL
));
}
...
...
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