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
efc4bc36
Commit
efc4bc36
authored
Apr 18, 2015
by
Wandenberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvement for buffered writing operations
parent
99243a4b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
ngx_http_push_stream_module_utils.c
src/ngx_http_push_stream_module_utils.c
+20
-7
No files found.
src/ngx_http_push_stream_module_utils.c
View file @
efc4bc36
...
...
@@ -601,24 +601,37 @@ ngx_http_push_stream_output_filter(ngx_http_request_t *r, ngx_chain_t *in)
ngx_http_core_loc_conf_t
*
clcf
;
ngx_http_push_stream_module_ctx_t
*
ctx
=
NULL
;
ngx_int_t
rc
;
ngx_event_t
*
wev
;
ngx_connection_t
*
c
;
c
=
r
->
connection
;
wev
=
c
->
write
;
rc
=
ngx_http_output_filter
(
r
,
in
);
if
(
rc
==
NGX_AGAIN
)
{
clcf
=
ngx_http_get_module_loc_conf
(
r
,
ngx_http_core_module
);
if
((
rc
==
NGX_OK
)
&&
(
ctx
=
ngx_http_get_module_ctx
(
r
,
ngx_http_push_stream_module
))
!=
NULL
)
{
ngx_chain_update_chains
(
r
->
pool
,
&
ctx
->
free
,
&
ctx
->
busy
,
&
in
,
(
ngx_buf_tag_t
)
&
ngx_http_push_stream_module
);
}
if
(
c
->
buffered
&
NGX_HTTP_LOWLEVEL_BUFFERED
)
{
clcf
=
ngx_http_get_module_loc_conf
(
r
->
main
,
ngx_http_core_module
);
r
->
write_event_handler
=
ngx_http_push_stream_flush_pending_output
;
if
(
ngx_handle_write_event
(
r
->
connection
->
write
,
clcf
->
send_lowat
)
!=
NGX_OK
)
{
if
(
!
wev
->
delayed
)
{
ngx_add_timer
(
wev
,
clcf
->
send_timeout
);
}
if
(
ngx_handle_write_event
(
wev
,
clcf
->
send_lowat
)
!=
NGX_OK
)
{
return
NGX_ERROR
;
}
return
NGX_OK
;
}
if
(
rc
==
NGX_OK
)
{
if
(
(
ctx
=
ngx_http_get_module_ctx
(
r
,
ngx_http_push_stream_module
))
!=
NULL
)
{
ngx_
chain_update_chains
(
r
->
pool
,
&
ctx
->
free
,
&
ctx
->
busy
,
&
in
,
(
ngx_buf_tag_t
)
&
ngx_http_push_stream_module
);
}
else
{
if
(
wev
->
timer_set
)
{
ngx_
del_timer
(
wev
);
}
}
...
...
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