Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
1caec7cb
Commit
1caec7cb
authored
Jun 20, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h2load: Fix memory leak detected by LeakSanitizer
parent
0cd26d6f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
src/h2load.cc
src/h2load.cc
+10
-4
src/h2load.h
src/h2load.h
+1
-1
No files found.
src/h2load.cc
View file @
1caec7cb
...
@@ -315,7 +315,7 @@ int Client::on_write()
...
@@ -315,7 +315,7 @@ int Client::on_write()
Worker
::
Worker
(
uint32_t
id
,
SSL_CTX
*
ssl_ctx
,
size_t
req_todo
,
size_t
nclients
,
Worker
::
Worker
(
uint32_t
id
,
SSL_CTX
*
ssl_ctx
,
size_t
req_todo
,
size_t
nclients
,
Config
*
config
)
Config
*
config
)
:
stats
{
0
},
evbase
(
event_base_new
()),
ssl_ctx
(
ssl_ctx
),
config
(
config
),
:
stats
{
0
},
evbase
(
event_base_new
()),
ssl_ctx
(
ssl_ctx
),
config
(
config
),
id
(
id
),
term_timer_started
(
false
)
term_timer
(
nullptr
),
id
(
id
)
{
{
stats
.
req_todo
=
req_todo
;
stats
.
req_todo
=
req_todo
;
progress_interval
=
std
::
max
((
size_t
)
1
,
req_todo
/
10
);
progress_interval
=
std
::
max
((
size_t
)
1
,
req_todo
/
10
);
...
@@ -326,6 +326,9 @@ Worker::Worker(uint32_t id, SSL_CTX *ssl_ctx, size_t req_todo, size_t nclients,
...
@@ -326,6 +326,9 @@ Worker::Worker(uint32_t id, SSL_CTX *ssl_ctx, size_t req_todo, size_t nclients,
Worker
::~
Worker
()
Worker
::~
Worker
()
{
{
if
(
term_timer
)
{
event_free
(
term_timer
);
}
event_base_free
(
evbase
);
event_base_free
(
evbase
);
}
}
...
@@ -350,11 +353,11 @@ void term_timeout_cb(evutil_socket_t fd, short what, void *arg)
...
@@ -350,11 +353,11 @@ void term_timeout_cb(evutil_socket_t fd, short what, void *arg)
void
Worker
::
schedule_terminate
()
void
Worker
::
schedule_terminate
()
{
{
if
(
term_timer
_started
)
{
if
(
term_timer
)
{
return
;
return
;
}
}
term_timer_started
=
true
;
auto
term_timer
=
evtimer_new
(
evbase
,
term_timeout_cb
,
this
);
term_timer
=
evtimer_new
(
evbase
,
term_timeout_cb
,
this
);
timeval
timeout
=
{
0
,
0
};
timeval
timeout
=
{
0
,
0
};
evtimer_add
(
term_timer
,
&
timeout
);
evtimer_add
(
term_timer
,
&
timeout
);
}
}
...
@@ -998,6 +1001,9 @@ int main(int argc, char **argv)
...
@@ -998,6 +1001,9 @@ int main(int argc, char **argv)
<<
worker
.
stats
.
bytes_head
<<
" bytes headers, "
<<
worker
.
stats
.
bytes_head
<<
" bytes headers, "
<<
worker
.
stats
.
bytes_body
<<
" bytes data"
<<
worker
.
stats
.
bytes_body
<<
" bytes data"
<<
std
::
endl
;
<<
std
::
endl
;
SSL_CTX_free
(
ssl_ctx
);
return
0
;
return
0
;
}
}
...
...
src/h2load.h
View file @
1caec7cb
...
@@ -113,9 +113,9 @@ struct Worker {
...
@@ -113,9 +113,9 @@ struct Worker {
event_base
*
evbase
;
event_base
*
evbase
;
SSL_CTX
*
ssl_ctx
;
SSL_CTX
*
ssl_ctx
;
Config
*
config
;
Config
*
config
;
event
*
term_timer
;
size_t
progress_interval
;
size_t
progress_interval
;
uint32_t
id
;
uint32_t
id
;
bool
term_timer_started
;
Worker
(
uint32_t
id
,
SSL_CTX
*
ssl_ctx
,
size_t
nreq_todo
,
size_t
nclients
,
Worker
(
uint32_t
id
,
SSL_CTX
*
ssl_ctx
,
size_t
nreq_todo
,
size_t
nclients
,
Config
*
config
);
Config
*
config
);
...
...
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