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
3b89b897
Commit
3b89b897
authored
Apr 09, 2013
by
Wandenberg Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add push_stream_channel_info_on_publish directive to be possible disable publish feedback stats
parent
064d4a3a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
1 deletion
+47
-1
README.textile
README.textile
+2
-0
publishers.textile
docs/directives/publishers.textile
+12
-0
ngx_http_push_stream_module.h
include/ngx_http_push_stream_module.h
+1
-0
nginx_configuration.rb
misc/spec/nginx_configuration.rb
+3
-0
properties_spec.rb
misc/spec/publisher/properties_spec.rb
+16
-0
ngx_http_push_stream_module_publisher.c
src/ngx_http_push_stream_module_publisher.c
+5
-1
ngx_http_push_stream_module_setup.c
src/ngx_http_push_stream_module_setup.c
+8
-0
No files found.
README.textile
View file @
3b89b897
...
...
@@ -138,6 +138,7 @@ h1(#directives). Directives
| "push_stream_websocket_allow_publish":push_stream_websocket_allow_publish | - | - | - | - | - | x |
| "push_stream_store_messages":push_stream_store_messages | - | - | - | x | - | x |
| "push_stream_keepalive":push_stream_keepalive | - | - | - | x | x | - |
| "push_stream_channel_info_on_publish":push_stream_channel_info_on_publish | - | - | - | x | - | - |
h1(#installation). Installation <a name="installation" href="#"> </a>
...
...
@@ -247,4 +248,5 @@ h1(#contributors). Contributors
[push_stream_padding_by_user_agent]https://github.com/wandenberg/nginx-push-stream-module/blob/master/docs/directives/subscribers.textile#push_stream_padding_by_user_agent
[push_stream_store_messages]https://github.com/wandenberg/nginx-push-stream-module/blob/master/docs/directives/publishers.textile#push_stream_store_messages
[push_stream_keepalive]https://github.com/wandenberg/nginx-push-stream-module/blob/master/docs/directives/publishers.textile#push_stream_keepalive
[push_stream_channel_info_on_publish]https://github.com/wandenberg/nginx-push-stream-module/blob/master/docs/directives/publishers.textile#push_stream_channel_info_on_publish
[push_stream_websocket_allow_publish]https://github.com/wandenberg/nginx-push-stream-module/blob/master/docs/directives/subscribers.textile#push_stream_websocket_allow_publish
docs/directives/publishers.textile
View file @
3b89b897
...
...
@@ -56,3 +56,15 @@ h2(#push_stream_keepalive). push_stream_keepalive <a name="push_stream_keepalive
*release version:* _0.2.4_
Enable keepalive connections, on publisher or channels statistics locations.
h2(#push_stream_channel_info_on_publish). push_stream_channel_info_on_publish <a name="push_stream_channel_info_on_publish" href="#"> </a>
*syntax:* _push_stream_channel_info_on_publish on | off_
*default:* _on_
*context:* _location (push_stream_publisher)_
*release version:* _0.3.5_
Enable send back channel information after publish a message.
include/ngx_http_push_stream_module.h
View file @
3b89b897
...
...
@@ -84,6 +84,7 @@ typedef struct {
ngx_msec_t
subscriber_connection_ttl
;
ngx_msec_t
longpolling_connection_ttl
;
ngx_flag_t
websocket_allow_publish
;
ngx_flag_t
channel_info_on_publish
;
ngx_http_complex_value_t
*
last_received_message_time
;
ngx_http_complex_value_t
*
last_received_message_tag
;
ngx_http_complex_value_t
*
user_agent
;
...
...
misc/spec/nginx_configuration.rb
View file @
3b89b897
...
...
@@ -50,6 +50,8 @@ module NginxConfiguration
:client_max_body_size
=>
'32k'
,
:client_body_buffer_size
=>
'32k'
,
:channel_info_on_publish
=>
"on"
,
:extra_location
=>
''
}
end
...
...
@@ -152,6 +154,7 @@ http {
set $push_stream_channel_id $arg_id;
<%= write_directive("push_stream_store_messages", store_messages, "store messages") %>
<%= write_directive("push_stream_keepalive", keepalive, "keepalive") %>
<%= write_directive("push_stream_channel_info_on_publish", channel_info_on_publish, "channel_info_on_publish") %>
# client_max_body_size MUST be equal to client_body_buffer_size or
# you will be sorry.
...
...
misc/spec/publisher/properties_spec.rb
View file @
3b89b897
...
...
@@ -356,6 +356,22 @@ describe "Publisher Properties" do
end
end
it
"should not receive channel info after publish a message when disabled"
do
body
=
'published message'
channel
=
'ch_test_skip_channel_info'
nginx_run_server
(
config
.
merge
(
:channel_info_on_publish
=>
"off"
))
do
|
conf
|
EventMachine
.
run
do
pub_1
=
EventMachine
::
HttpRequest
.
new
(
nginx_address
+
'/pub?id='
+
channel
.
to_s
).
post
:head
=>
headers
,
:body
=>
body
pub_1
.
callback
do
pub_1
.
should
be_http_status
(
200
).
without_body
EventMachine
.
stop
end
end
end
end
context
"when allow origin directive is set"
do
it
"should receive acess control allow headers"
do
channel
=
'test_access_control_allow_headers'
...
...
src/ngx_http_push_stream_module_publisher.c
View file @
3b89b897
...
...
@@ -198,7 +198,11 @@ ngx_http_push_stream_publisher_body_handler(ngx_http_request_t *r)
return
;
}
ngx_http_push_stream_send_response_channel_info
(
r
,
channel
);
if
(
cf
->
channel_info_on_publish
)
{
ngx_http_push_stream_send_response_channel_info
(
r
,
channel
);
}
else
{
ngx_http_push_stream_send_only_header_response
(
r
,
NGX_HTTP_OK
,
NULL
);
}
ngx_http_finalize_request
(
r
,
NGX_OK
);
return
;
}
...
...
src/ngx_http_push_stream_module_setup.c
View file @
3b89b897
...
...
@@ -128,6 +128,12 @@ static ngx_command_t ngx_http_push_stream_commands[] = {
NGX_HTTP_LOC_CONF_OFFSET
,
offsetof
(
ngx_http_push_stream_loc_conf_t
,
store_messages
),
NULL
},
{
ngx_string
(
"push_stream_channel_info_on_publish"
),
NGX_HTTP_MAIN_CONF
|
NGX_HTTP_SRV_CONF
|
NGX_HTTP_LOC_CONF
|
NGX_CONF_TAKE1
,
ngx_conf_set_flag_slot
,
NGX_HTTP_LOC_CONF_OFFSET
,
offsetof
(
ngx_http_push_stream_loc_conf_t
,
channel_info_on_publish
),
NULL
},
{
ngx_string
(
"push_stream_authorized_channels_only"
),
NGX_HTTP_MAIN_CONF
|
NGX_HTTP_SRV_CONF
|
NGX_HTTP_LOC_CONF
|
NGX_CONF_TAKE1
,
ngx_conf_set_flag_slot
,
...
...
@@ -537,6 +543,7 @@ ngx_http_push_stream_create_loc_conf(ngx_conf_t *cf)
lcf
->
subscriber_connection_ttl
=
NGX_CONF_UNSET_MSEC
;
lcf
->
longpolling_connection_ttl
=
NGX_CONF_UNSET_MSEC
;
lcf
->
websocket_allow_publish
=
NGX_CONF_UNSET_UINT
;
lcf
->
channel_info_on_publish
=
NGX_CONF_UNSET_UINT
;
lcf
->
last_received_message_time
=
NULL
;
lcf
->
last_received_message_tag
=
NULL
;
lcf
->
user_agent
=
NULL
;
...
...
@@ -566,6 +573,7 @@ ngx_http_push_stream_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_msec_value
(
conf
->
subscriber_connection_ttl
,
prev
->
subscriber_connection_ttl
,
NGX_CONF_UNSET_MSEC
);
ngx_conf_merge_msec_value
(
conf
->
longpolling_connection_ttl
,
prev
->
longpolling_connection_ttl
,
conf
->
subscriber_connection_ttl
);
ngx_conf_merge_value
(
conf
->
websocket_allow_publish
,
prev
->
websocket_allow_publish
,
0
);
ngx_conf_merge_value
(
conf
->
channel_info_on_publish
,
prev
->
channel_info_on_publish
,
1
);
ngx_conf_merge_str_value
(
conf
->
padding_by_user_agent
,
prev
->
padding_by_user_agent
,
NGX_HTTP_PUSH_STREAM_DEFAULT_PADDING_BY_USER_AGENT
);
ngx_conf_merge_str_value
(
conf
->
allowed_origins
,
prev
->
allowed_origins
,
NGX_HTTP_PUSH_STREAM_DEFAULT_ALLOWED_ORIGINS
);
...
...
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