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
e0b3877e
Commit
e0b3877e
authored
Apr 25, 2015
by
Wandenberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix to not deal with already closed websocket connections
parent
1ab9e74e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
ngx_http_push_stream_module_websocket.c
src/ngx_http_push_stream_module_websocket.c
+7
-8
No files found.
src/ngx_http_push_stream_module_websocket.c
View file @
e0b3877e
...
@@ -195,6 +195,10 @@ ngx_http_push_stream_websocket_reading(ngx_http_request_t *r)
...
@@ -195,6 +195,10 @@ ngx_http_push_stream_websocket_reading(ngx_http_request_t *r)
rev
=
c
->
read
;
rev
=
c
->
read
;
for
(;;)
{
for
(;;)
{
if
(
c
->
error
||
c
->
timedout
||
c
->
close
||
c
->
destroyed
||
rev
->
closed
||
rev
->
eof
)
{
goto
finalize
;
}
switch
(
ctx
->
frame
->
step
)
{
switch
(
ctx
->
frame
->
step
)
{
case
NGX_HTTP_PUSH_STREAM_WEBSOCKET_READ_START_STEP
:
case
NGX_HTTP_PUSH_STREAM_WEBSOCKET_READ_START_STEP
:
//reading frame header
//reading frame header
...
@@ -299,10 +303,10 @@ ngx_http_push_stream_websocket_reading(ngx_http_request_t *r)
...
@@ -299,10 +303,10 @@ ngx_http_push_stream_websocket_reading(ngx_http_request_t *r)
if
(
ctx
->
frame
->
opcode
==
NGX_HTTP_PUSH_STREAM_WEBSOCKET_CLOSE_OPCODE
)
{
if
(
ctx
->
frame
->
opcode
==
NGX_HTTP_PUSH_STREAM_WEBSOCKET_CLOSE_OPCODE
)
{
ngx_http_push_stream_send_response_finalize
(
r
);
ngx_http_push_stream_send_response_finalize
(
r
);
}
else
{
ctx
->
frame
->
step
=
NGX_HTTP_PUSH_STREAM_WEBSOCKET_READ_START_STEP
;
ctx
->
frame
->
last
=
NULL
;
}
}
ctx
->
frame
->
step
=
NGX_HTTP_PUSH_STREAM_WEBSOCKET_READ_START_STEP
;
ctx
->
frame
->
last
=
NULL
;
return
;
return
;
break
;
break
;
...
@@ -345,11 +349,6 @@ finalize:
...
@@ -345,11 +349,6 @@ finalize:
ngx_int_t
ngx_int_t
ngx_http_push_stream_recv
(
ngx_connection_t
*
c
,
ngx_event_t
*
rev
,
ngx_buf_t
*
buf
,
ssize_t
len
)
ngx_http_push_stream_recv
(
ngx_connection_t
*
c
,
ngx_event_t
*
rev
,
ngx_buf_t
*
buf
,
ssize_t
len
)
{
{
if
(
c
->
error
||
c
->
timedout
||
c
->
close
||
c
->
destroyed
||
rev
->
closed
||
rev
->
eof
)
{
return
NGX_ERROR
;
}
ssize_t
n
=
c
->
recv
(
c
,
buf
->
last
,
len
);
ssize_t
n
=
c
->
recv
(
c
,
buf
->
last
,
len
);
if
(
n
==
NGX_AGAIN
)
{
if
(
n
==
NGX_AGAIN
)
{
...
...
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