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
312f330a
Commit
312f330a
authored
Jul 13, 2014
by
Wandenberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor on ngx_http_push_stream_websocket_reading to deal with NGX_AGAIN
parent
8e340def
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
182 additions
and
95 deletions
+182
-95
ngx_http_push_stream_module.h
include/ngx_http_push_stream_module.h
+16
-0
ngx_http_push_stream_module_websocket.h
include/ngx_http_push_stream_module_websocket.h
+5
-12
ngx_http_push_stream_module_websocket.c
src/ngx_http_push_stream_module_websocket.c
+161
-83
No files found.
include/ngx_http_push_stream_module.h
View file @
312f330a
...
...
@@ -178,6 +178,21 @@ typedef struct {
ngx_uint_t
backtrack_messages
;
}
ngx_http_push_stream_requested_channel_t
;
typedef
struct
{
unsigned
char
fin
:
1
;
unsigned
char
rsv1
:
1
;
unsigned
char
rsv2
:
1
;
unsigned
char
rsv3
:
1
;
unsigned
char
opcode
:
4
;
unsigned
char
mask
:
1
;
unsigned
char
mask_key
[
4
];
uint64_t
payload_len
;
u_char
header
[
8
];
u_char
*
payload
;
u_char
*
last
;
ngx_uint_t
step
;
}
ngx_http_push_stream_frame_t
;
typedef
struct
{
ngx_event_t
*
disconnect_timer
;
ngx_event_t
*
ping_timer
;
...
...
@@ -189,6 +204,7 @@ typedef struct {
ngx_http_push_stream_padding_t
*
padding
;
ngx_str_t
*
callback
;
ngx_http_push_stream_requested_channel_t
*
requested_channels
;
ngx_http_push_stream_frame_t
*
frame
;
}
ngx_http_push_stream_module_ctx_t
;
// messages to worker processes
...
...
include/ngx_http_push_stream_module_websocket.h
View file @
312f330a
...
...
@@ -33,18 +33,11 @@
#include <ngx_http_push_stream_module_utils.h>
#include <ngx_http_push_stream_module_subscriber.h>
typedef
struct
{
unsigned
char
fin
:
1
;
unsigned
char
rsv1
:
1
;
unsigned
char
rsv2
:
1
;
unsigned
char
rsv3
:
1
;
unsigned
char
opcode
:
4
;
unsigned
char
mask
:
1
;
unsigned
char
mask_key
[
4
];
uint64_t
payload_len
;
u_char
*
payload
;
}
ngx_http_push_stream_frame_t
;
static
ngx_int_t
ngx_http_push_stream_websocket_handler
(
ngx_http_request_t
*
r
);
#define NGX_HTTP_PUSH_STREAM_WEBSOCKET_READ_START_STEP 0
#define NGX_HTTP_PUSH_STREAM_WEBSOCKET_READ_GET_REAL_SIZE_STEP 1
#define NGX_HTTP_PUSH_STREAM_WEBSOCKET_READ_GET_MASK_KEY_STEP 2
#define NGX_HTTP_PUSH_STREAM_WEBSOCKET_READ_GET_PAYLOAD_STEP 3
#endif
/* NGX_HTTP_PUSH_STREAM_MODULE_WEBSOCKET_H_ */
src/ngx_http_push_stream_module_websocket.c
View file @
312f330a
This diff is collapsed.
Click to expand it.
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