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
211464e8
Commit
211464e8
authored
Sep 25, 2011
by
Wandenberg Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
always setting time, tag and expires, not only when store messages is on
parent
bae2c292
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
ngx_http_push_stream_module_publisher.c
src/ngx_http_push_stream_module_publisher.c
+8
-8
No files found.
src/ngx_http_push_stream_module_publisher.c
View file @
211464e8
...
...
@@ -205,21 +205,21 @@ ngx_http_push_stream_publisher_body_handler(ngx_http_request_t *r)
channel
->
last_message_id
++
;
((
ngx_http_push_stream_shm_data_t
*
)
ngx_http_push_stream_shm_zone
->
data
)
->
published_messages
++
;
// tag message with time stamp and a sequence tag
msg
->
time
=
ngx_time
();
msg
->
tag
=
(
msg
->
time
==
channel
->
last_message_time
)
?
(
channel
->
last_message_tag
+
1
)
:
0
;
channel
->
last_message_time
=
msg
->
time
;
channel
->
last_message_tag
=
msg
->
tag
;
// set message expiration time
msg
->
expires
=
(
ngx_http_push_stream_module_main_conf
->
message_ttl
==
NGX_CONF_UNSET
?
0
:
(
ngx_time
()
+
ngx_http_push_stream_module_main_conf
->
message_ttl
));
// put messages on the queue
if
(
cf
->
store_messages
)
{
// tag message with time stamp and a sequence tag
msg
->
time
=
ngx_time
();
msg
->
tag
=
(
msg
->
time
==
channel
->
last_message_time
)
?
(
channel
->
last_message_tag
+
1
)
:
0
;
// set message expiration time
msg
->
expires
=
(
ngx_http_push_stream_module_main_conf
->
message_ttl
==
NGX_CONF_UNSET
?
0
:
(
ngx_time
()
+
ngx_http_push_stream_module_main_conf
->
message_ttl
));
ngx_queue_insert_tail
(
&
channel
->
message_queue
.
queue
,
&
msg
->
queue
);
channel
->
stored_messages
++
;
// now see if the queue is too big
ngx_http_push_stream_ensure_qtd_of_messages_locked
(
channel
,
ngx_http_push_stream_module_main_conf
->
max_messages_stored_per_channel
,
0
);
channel
->
last_message_time
=
msg
->
time
;
channel
->
last_message_tag
=
msg
->
tag
;
}
ngx_shmtx_unlock
(
&
shpool
->
mutex
);
...
...
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