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
8e467fba
Commit
8e467fba
authored
Jun 04, 2011
by
Wandenberg Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug of segfault when the module is part of nginx but not in use
parent
bdbe3706
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
1 deletion
+38
-1
ngx_http_push_stream_module_setup.c
src/ngx_http_push_stream_module_setup.c
+8
-0
base_test_case.rb
test/base_test_case.rb
+2
-1
test_setup_parameters.rb
test/test_setup_parameters.rb
+28
-0
No files found.
src/ngx_http_push_stream_module_setup.c
View file @
8e467fba
...
...
@@ -177,6 +177,10 @@ ngx_http_push_stream_init_module(ngx_cycle_t *cycle)
{
ngx_core_conf_t
*
ccf
=
(
ngx_core_conf_t
*
)
ngx_get_conf
(
cycle
->
conf_ctx
,
ngx_core_module
);
if
(
ngx_http_push_stream_shm_zone
==
NULL
)
{
ngx_log_error
(
NGX_LOG_NOTICE
,
cycle
->
log
,
0
,
"ngx_http_push_stream_module will not be used with this configuration."
);
return
NGX_OK
;
}
ngx_http_push_stream_worker_processes
=
ccf
->
worker_processes
;
...
...
@@ -188,6 +192,10 @@ ngx_http_push_stream_init_module(ngx_cycle_t *cycle)
static
ngx_int_t
ngx_http_push_stream_init_worker
(
ngx_cycle_t
*
cycle
)
{
if
(
ngx_http_push_stream_shm_zone
==
NULL
)
{
return
NGX_OK
;
}
if
((
ngx_http_push_stream_init_ipc_shm
(
ngx_http_push_stream_worker_processes
))
!=
NGX_OK
)
{
return
NGX_ERROR
;
}
...
...
test/base_test_case.rb
View file @
8e467fba
...
...
@@ -73,7 +73,7 @@ module BaseTestCase
end
def
create_config_file
template
=
ERB
.
new
@@config_template
template
=
ERB
.
new
@
config_template
||
@
@config_template
config_content
=
template
.
result
(
binding
)
File
.
open
(
config_filename
,
'w'
)
{
|
f
|
f
.
write
(
config_content
)
}
File
.
open
(
mime_types_filename
,
'w'
)
{
|
f
|
f
.
write
(
@@mime_tipes_template
)
}
...
...
@@ -151,6 +151,7 @@ module BaseTestCase
@store_messages
=
'on'
@subscriber_connection_timeout
=
nil
@memory_cleanup_timeout
=
'5m'
@config_template
=
nil
end
def
publish_message
(
channel
,
headers
,
body
)
...
...
test/test_setup_parameters.rb
View file @
8e467fba
...
...
@@ -159,4 +159,32 @@ class TestSetuParameters < Test::Unit::TestCase
stderr_msg
=
self
.
start_server
assert
(
stderr_msg
.
include?
(
expected_error_message
),
"Message error not founded: '
#{
expected_error_message
}
' recieved '
#{
stderr_msg
}
'"
)
end
def
config_test_http_not_configured
@test_config_file
=
"test_http_not_configured.conf"
@config_template
=
%q{
pid <%= @pid_file %>;
error_log <%= @main_error_log %> debug;
# Development Mode
master_process off;
daemon off;
worker_processes <%=nginx_workers%>;
events {
worker_connections 1024;
use <%= (RUBY_PLATFORM =~ /darwin/) ? 'kqueue' : 'epoll' %>;
}
}
end
def
test_http_not_configured
expected_error_message
=
"ngx_http_push_stream_module will not be used with this configuration."
self
.
create_config_file
self
.
start_server
log_file
=
File
.
read
(
@main_error_log
)
assert
(
log_file
.
include?
(
expected_error_message
),
"Message error not founded: '
#{
expected_error_message
}
' recieved '
#{
log_file
}
'"
)
ensure
self
.
stop_server
end
end
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