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
a59d8aac
Commit
a59d8aac
authored
Dec 29, 2011
by
Wandenberg Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding function ngx_http_push_stream_free_worker_message_memory_loked
parent
5c11f011
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
11 deletions
+17
-11
ngx_http_push_stream_module_utils.h
include/ngx_http_push_stream_module_utils.h
+1
-1
ngx_http_push_stream_module_version.h
include/ngx_http_push_stream_module_version.h
+1
-1
ngx_http_push_stream_module_ipc.c
src/ngx_http_push_stream_module_ipc.c
+2
-8
ngx_http_push_stream_module_utils.c
src/ngx_http_push_stream_module_utils.c
+13
-1
No files found.
include/ngx_http_push_stream_module_utils.h
View file @
a59d8aac
...
...
@@ -254,6 +254,7 @@ static void ngx_http_push_stream_delete_channel(ngx_str_t *id, n
static
void
ngx_http_push_stream_collect_expired_messages
(
ngx_http_push_stream_shm_data_t
*
data
,
ngx_slab_pool_t
*
shpool
,
ngx_rbtree_node_t
*
node
,
ngx_flag_t
force
);
static
void
ngx_http_push_stream_collect_expired_messages_and_empty_channels
(
ngx_http_push_stream_shm_data_t
*
data
,
ngx_slab_pool_t
*
shpool
,
ngx_rbtree_node_t
*
node
,
ngx_flag_t
force
);
static
void
ngx_http_push_stream_free_message_memory_locked
(
ngx_slab_pool_t
*
shpool
,
ngx_http_push_stream_msg_t
*
msg
);
static
void
ngx_http_push_stream_free_worker_message_memory_locked
(
ngx_slab_pool_t
*
shpool
,
ngx_http_push_stream_worker_msg_t
*
worker_msg
);
static
ngx_int_t
ngx_http_push_stream_free_memory_of_expired_messages_and_channels
(
ngx_flag_t
force
);
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
);
static
ngx_inline
void
ngx_http_push_stream_delete_worker_channel
(
void
);
...
...
@@ -263,7 +264,6 @@ static ngx_http_push_stream_content_subtype_t * ngx_http_push_stream_match_c
static
ngx_http_push_stream_line_t
*
ngx_http_push_stream_split_by_crlf
(
ngx_str_t
*
msg
,
ngx_pool_t
*
temp_pool
);
static
ngx_str_t
*
ngx_http_push_stream_join_with_crlf
(
ngx_http_push_stream_line_t
*
lines
,
ngx_pool_t
*
temp_pool
);
static
ngx_str_t
*
ngx_http_push_stream_get_formatted_current_time
(
ngx_pool_t
*
pool
);
static
ngx_str_t
*
ngx_http_push_stream_get_formatted_hostname
(
ngx_pool_t
*
pool
);
...
...
include/ngx_http_push_stream_module_version.h
View file @
a59d8aac
...
...
@@ -27,6 +27,6 @@
#define NGX_HTTP_PUSH_STREAM_MODULE_VERSION_H_
static
const
ngx_str_t
NGX_HTTP_PUSH_STREAM_TAG
=
ngx_string
(
"0.3.2"
);
static
const
ngx_str_t
NGX_HTTP_PUSH_STREAM_COMMIT
=
ngx_string
(
"
e72b082850848b16264d4096641fc8f1a639d330
"
);
static
const
ngx_str_t
NGX_HTTP_PUSH_STREAM_COMMIT
=
ngx_string
(
"
f7ea53db0f1122817cdf2586ae4e14ad12d34cfd
"
);
#endif
/* NGX_HTTP_PUSH_STREAM_MODULE_VERSION_H_ */
src/ngx_http_push_stream_module_ipc.c
View file @
a59d8aac
...
...
@@ -172,8 +172,7 @@ ngx_http_push_stream_clean_worker_data()
ngx_shmtx_lock
(
&
shpool
->
mutex
);
if
(
data
->
ipc
[
ngx_process_slot
].
messages_queue
!=
NULL
)
{
while
((
cur_msg
=
(
ngx_http_push_stream_worker_msg_t
*
)
ngx_queue_next
(
&
data
->
ipc
[
ngx_process_slot
].
messages_queue
->
queue
))
!=
data
->
ipc
[
ngx_process_slot
].
messages_queue
)
{
ngx_queue_remove
(
&
cur_msg
->
queue
);
ngx_slab_free_locked
(
shpool
,
cur_msg
);
ngx_http_push_stream_free_worker_message_memory_locked
(
shpool
,
cur_msg
);
}
}
...
...
@@ -316,12 +315,7 @@ ngx_http_push_stream_process_worker_message(void)
// free worker_msg already sent
ngx_shmtx_lock
(
&
shpool
->
mutex
);
worker_msg
->
msg
->
workers_ref_count
--
;
if
((
worker_msg
->
msg
->
workers_ref_count
<=
0
)
&&
worker_msg
->
msg
->
deleted
)
{
worker_msg
->
msg
->
expires
=
ngx_time
()
+
ngx_http_push_stream_module_main_conf
->
shm_cleanup_objects_ttl
;
}
ngx_queue_remove
(
&
worker_msg
->
queue
);
ngx_slab_free_locked
(
shpool
,
worker_msg
);
ngx_http_push_stream_free_worker_message_memory_locked
(
shpool
,
worker_msg
);
ngx_shmtx_unlock
(
&
shpool
->
mutex
);
}
}
...
...
src/ngx_http_push_stream_module_utils.c
View file @
a59d8aac
...
...
@@ -762,6 +762,18 @@ ngx_http_push_stream_free_message_memory_locked(ngx_slab_pool_t *shpool, ngx_htt
}
static
void
ngx_http_push_stream_free_worker_message_memory_locked
(
ngx_slab_pool_t
*
shpool
,
ngx_http_push_stream_worker_msg_t
*
worker_msg
)
{
worker_msg
->
msg
->
workers_ref_count
--
;
if
((
worker_msg
->
msg
->
workers_ref_count
<=
0
)
&&
worker_msg
->
msg
->
deleted
)
{
worker_msg
->
msg
->
expires
=
ngx_time
()
+
ngx_http_push_stream_module_main_conf
->
shm_cleanup_objects_ttl
;
}
ngx_queue_remove
(
&
worker_msg
->
queue
);
ngx_slab_free_locked
(
shpool
,
worker_msg
);
}
static
void
ngx_http_push_stream_mark_message_to_delete_locked
(
ngx_http_push_stream_msg_t
*
msg
)
{
...
...
@@ -783,7 +795,7 @@ ngx_http_push_stream_timer_set(ngx_msec_t timer_interval, ngx_event_t *event, ng
ngx_shmtx_lock
(
&
shpool
->
mutex
);
if
(
event
->
handler
==
NULL
)
{
event
->
handler
=
event_handler
;
event
->
data
=
NULL
;
event
->
data
=
event
;
//set event as data to avoid error when running on debug mode (on log event)
event
->
log
=
ngx_cycle
->
log
;
ngx_http_push_stream_timer_reset
(
timer_interval
,
event
);
}
...
...
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