Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nginx-push-stream-module
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
nginx-push-stream-module
Commits
a50bee71
Commit
a50bee71
authored
Jun 08, 2011
by
Wandenberg Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor to put code responsable to free channel memory in a different function
parent
ec18573c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
13 deletions
+22
-13
ngx_http_push_stream_module_utils.c
src/ngx_http_push_stream_module_utils.c
+22
-13
No files found.
src/ngx_http_push_stream_module_utils.c
View file @
a50bee71
...
...
@@ -25,6 +25,8 @@
#include <ngx_http_push_stream_module_utils.h>
static
void
nxg_http_push_stream_free_channel_memory_locked
(
ngx_slab_pool_t
*
shpool
,
ngx_http_push_stream_channel_t
*
channel
);
static
ngx_inline
void
ngx_http_push_stream_ensure_qtd_of_messages_locked
(
ngx_http_push_stream_channel_t
*
channel
,
ngx_uint_t
max_messages
,
ngx_flag_t
expired
)
{
ngx_http_push_stream_msg_t
*
sentinel
,
*
msg
;
...
...
@@ -299,23 +301,30 @@ ngx_http_push_stream_free_memory_of_expired_channels_locked(ngx_rbtree_t *tree,
if
((
ngx_time
()
>
channel
->
expires
)
||
force
)
{
ngx_rbtree_delete
(
tree
,
node
);
// delete the worker-subscriber queue
ngx_http_push_stream_pid_queue_t
*
workers_sentinel
,
*
cur
,
*
next
;
nxg_http_push_stream_free_channel_memory_locked
(
shpool
,
channel
);
}
}
}
workers_sentinel
=
&
channel
->
workers_with_subscribers
;
cur
=
(
ngx_http_push_stream_pid_queue_t
*
)
ngx_queue_next
(
&
workers_sentinel
->
queue
);
while
(
cur
!=
workers_sentinel
)
{
next
=
(
ngx_http_push_stream_pid_queue_t
*
)
ngx_queue_next
(
&
cur
->
queue
);
ngx_queue_remove
(
&
cur
->
queue
);
ngx_slab_free_locked
(
shpool
,
cur
);
cur
=
next
;
}
static
void
nxg_http_push_stream_free_channel_memory_locked
(
ngx_slab_pool_t
*
shpool
,
ngx_http_push_stream_channel_t
*
channel
)
{
// delete the worker-subscriber queue
ngx_http_push_stream_pid_queue_t
*
workers_sentinel
,
*
cur
,
*
next
;
ngx_slab_free_locked
(
shpool
,
channel
->
id
.
data
);
ngx_slab_free_locked
(
shpool
,
channel
);
}
workers_sentinel
=
&
channel
->
workers_with_subscribers
;
cur
=
(
ngx_http_push_stream_pid_queue_t
*
)
ngx_queue_next
(
&
workers_sentinel
->
queue
);
while
(
cur
!=
workers_sentinel
)
{
next
=
(
ngx_http_push_stream_pid_queue_t
*
)
ngx_queue_next
(
&
cur
->
queue
);
ngx_queue_remove
(
&
cur
->
queue
);
ngx_slab_free_locked
(
shpool
,
cur
);
cur
=
next
;
}
ngx_slab_free_locked
(
shpool
,
channel
->
id
.
data
);
ngx_slab_free_locked
(
shpool
,
channel
);
}
...
...
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