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
bf35d0f9
Commit
bf35d0f9
authored
Jul 14, 2011
by
Wandenberg Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renaming some functions, constants and variables
parent
b434a517
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
28 deletions
+28
-28
ngx_http_push_stream_module.h
include/ngx_http_push_stream_module.h
+2
-2
ngx_http_push_stream_module_utils.h
include/ngx_http_push_stream_module_utils.h
+7
-7
ngx_http_push_stream_module.c
src/ngx_http_push_stream_module.c
+2
-2
ngx_http_push_stream_module_ipc.c
src/ngx_http_push_stream_module_ipc.c
+2
-2
ngx_http_push_stream_module_setup.c
src/ngx_http_push_stream_module_setup.c
+2
-2
ngx_http_push_stream_module_subscriber.c
src/ngx_http_push_stream_module_subscriber.c
+1
-1
ngx_http_push_stream_module_utils.c
src/ngx_http_push_stream_module_utils.c
+12
-12
No files found.
include/ngx_http_push_stream_module.h
View file @
bf35d0f9
...
...
@@ -70,7 +70,7 @@ typedef struct {
}
ngx_http_push_stream_loc_conf_t
;
// shared memory segment name
static
ngx_str_t
ngx_push_stream_shm_name
=
ngx_string
(
"push_stream_module"
);
static
ngx_str_t
ngx_
http_
push_stream_shm_name
=
ngx_string
(
"push_stream_module"
);
// message queue
typedef
struct
{
...
...
@@ -199,7 +199,7 @@ static ngx_str_t NGX_HTTP_PUSH_STREAM_EMPTY = ngx_string("");
static
const
ngx_str_t
NGX_HTTP_PUSH_STREAM_BACKTRACK_SEP
=
ngx_string
(
".b"
);
static
const
ngx_str_t
NGX_HTTP_PUSH_STREAM_SLASH
=
ngx_string
(
"/"
);
static
const
ngx_str_t
NGX_PUSH_STREAM_DATE_FORMAT_ISO_8601
=
ngx_string
(
"%4d-%02d-%02dT%02d:%02d:%02d"
);
static
const
ngx_str_t
NGX_
HTTP_
PUSH_STREAM_DATE_FORMAT_ISO_8601
=
ngx_string
(
"%4d-%02d-%02dT%02d:%02d:%02d"
);
//// headers
static
const
ngx_str_t
NGX_HTTP_PUSH_STREAM_HEADER_ALLOW
=
ngx_string
(
"Allow"
);
...
...
include/ngx_http_push_stream_module_utils.h
View file @
bf35d0f9
...
...
@@ -179,13 +179,13 @@ static ngx_http_push_stream_content_subtype_t subtypes[] = {
&
NGX_HTTP_PUSH_STREAM_CHANNELS_INFO_SUMMARIZED_WORKER_LAST_ITEM_YAML
}
};
static
const
ngx_int_t
NGX_PUSH_STREAM_PING_MESSAGE_ID
=
-
1
;
static
const
ngx_str_t
NGX_PUSH_STREAM_PING_MESSAGE_TEXT
=
ngx_string
(
""
);
static
const
ngx_str_t
NGX_PUSH_STREAM_PING_CHANNEL_ID
=
ngx_string
(
""
);
static
const
ngx_int_t
NGX_
HTTP_
PUSH_STREAM_PING_MESSAGE_ID
=
-
1
;
static
const
ngx_str_t
NGX_
HTTP_
PUSH_STREAM_PING_MESSAGE_TEXT
=
ngx_string
(
""
);
static
const
ngx_str_t
NGX_
HTTP_
PUSH_STREAM_PING_CHANNEL_ID
=
ngx_string
(
""
);
static
const
ngx_str_t
NGX_PUSH_STREAM_TOKEN_MESSAGE_ID
=
ngx_string
(
"~id~"
);
static
const
ngx_str_t
NGX_PUSH_STREAM_TOKEN_MESSAGE_CHANNEL
=
ngx_string
(
"~channel~"
);
static
const
ngx_str_t
NGX_PUSH_STREAM_TOKEN_MESSAGE_TEXT
=
ngx_string
(
"~text~"
);
static
const
ngx_str_t
NGX_
HTTP_
PUSH_STREAM_TOKEN_MESSAGE_ID
=
ngx_string
(
"~id~"
);
static
const
ngx_str_t
NGX_
HTTP_
PUSH_STREAM_TOKEN_MESSAGE_CHANNEL
=
ngx_string
(
"~channel~"
);
static
const
ngx_str_t
NGX_
HTTP_
PUSH_STREAM_TOKEN_MESSAGE_TEXT
=
ngx_string
(
"~text~"
);
ngx_event_t
ngx_http_push_stream_ping_event
;
ngx_event_t
ngx_http_push_stream_disconnect_event
;
...
...
@@ -203,7 +203,7 @@ static u_char * ngx_http_push_stream_str_replace(u_char *org, u_char
static
ngx_str_t
*
ngx_http_push_stream_get_formatted_message
(
ngx_http_request_t
*
r
,
ngx_http_push_stream_channel_t
*
channel
,
ngx_http_push_stream_msg_t
*
msg
,
ngx_pool_t
*
temp_pool
);
static
ngx_str_t
*
ngx_http_push_stream_format_message
(
ngx_http_push_stream_channel_t
*
channel
,
ngx_http_push_stream_msg_t
*
message
,
ngx_str_t
message_template
,
ngx_pool_t
*
temp_pool
);
static
ngx_int_t
ngx_http_push_stream_send_response_content_header
(
ngx_http_request_t
*
r
,
ngx_http_push_stream_loc_conf_t
*
pslcf
);
static
ngx_int_t
ngx_http_push_stream_send_response_
chunk
(
ngx_http_request_t
*
r
,
const
u_char
*
chunk_text
,
uint
chunk_
len
,
ngx_flag_t
last_buffer
);
static
ngx_int_t
ngx_http_push_stream_send_response_
text
(
ngx_http_request_t
*
r
,
const
u_char
*
text
,
uint
len
,
ngx_flag_t
last_buffer
);
static
ngx_int_t
ngx_http_push_stream_send_ping
(
ngx_log_t
*
log
,
ngx_http_push_stream_loc_conf_t
*
pslcf
);
static
ngx_int_t
ngx_http_push_stream_memory_cleanup
(
ngx_log_t
*
log
,
ngx_http_push_stream_main_conf_t
*
psmcf
);
static
ngx_int_t
ngx_http_push_stream_buffer_cleanup
(
ngx_log_t
*
log
,
ngx_http_push_stream_loc_conf_t
*
pslcf
);
...
...
src/ngx_http_push_stream_module.c
View file @
bf35d0f9
...
...
@@ -299,9 +299,9 @@ ngx_http_push_stream_send_response_all_channels_info_detailed(ngx_http_request_t
return
rc
;
}
ngx_http_push_stream_send_response_
chunk
(
r
,
header_response
.
data
,
header_response
.
len
,
0
);
ngx_http_push_stream_send_response_
text
(
r
,
header_response
.
data
,
header_response
.
len
,
0
);
ngx_http_output_filter
(
r
,
first
);
return
ngx_http_push_stream_send_response_
chunk
(
r
,
tail
->
data
,
tail
->
len
,
1
);
return
ngx_http_push_stream_send_response_
text
(
r
,
tail
->
data
,
tail
->
len
,
1
);
}
static
ngx_int_t
...
...
src/ngx_http_push_stream_module_ipc.c
View file @
bf35d0f9
...
...
@@ -317,7 +317,7 @@ ngx_http_push_stream_send_worker_ping_message(void)
if
(
cur
->
request
!=
NULL
)
{
ngx_str_t
*
str
=
ngx_http_push_stream_get_formatted_message
(
cur
->
request
,
NULL
,
ngx_http_push_stream_ping_msg
,
cur
->
request
->
pool
);
if
(
str
!=
NULL
)
{
ngx_http_push_stream_send_response_
chunk
(
cur
->
request
,
str
->
data
,
str
->
len
,
0
);
ngx_http_push_stream_send_response_
text
(
cur
->
request
,
str
->
data
,
str
->
len
,
0
);
}
}
}
...
...
@@ -450,7 +450,7 @@ ngx_http_push_stream_respond_to_subscribers(ngx_http_push_stream_channel_t *chan
while
((
cur
=
(
ngx_http_push_stream_subscriber_t
*
)
ngx_queue_next
(
&
cur
->
queue
))
!=
sentinel
)
{
ngx_str_t
*
str
=
ngx_http_push_stream_get_formatted_message
(
cur
->
request
,
channel
,
msg
,
cur
->
request
->
pool
);
if
(
str
!=
NULL
)
{
ngx_http_push_stream_send_response_
chunk
(
cur
->
request
,
str
->
data
,
str
->
len
,
0
);
ngx_http_push_stream_send_response_
text
(
cur
->
request
,
str
->
data
,
str
->
len
,
0
);
}
}
}
...
...
src/ngx_http_push_stream_module_setup.c
View file @
bf35d0f9
...
...
@@ -563,7 +563,7 @@ ngx_http_push_stream_subscriber(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
static
ngx_int_t
ngx_http_push_stream_set_up_shm
(
ngx_conf_t
*
cf
,
size_t
shm_size
)
{
ngx_http_push_stream_shm_zone
=
ngx_shared_memory_add
(
cf
,
&
ngx_push_stream_shm_name
,
shm_size
,
&
ngx_http_push_stream_module
);
ngx_http_push_stream_shm_zone
=
ngx_shared_memory_add
(
cf
,
&
ngx_
http_
push_stream_shm_name
,
shm_size
,
&
ngx_http_push_stream_module
);
if
(
ngx_http_push_stream_shm_zone
==
NULL
)
{
return
NGX_ERROR
;
...
...
@@ -615,7 +615,7 @@ ngx_http_push_stream_init_shm_zone(ngx_shm_zone_t *shm_zone, void *data)
ngx_rbtree_init
(
&
d
->
channels_to_delete
,
remove_sentinel
,
ngx_http_push_stream_rbtree_insert
);
// create ping message
ngx_http_push_stream_ping_msg
=
ngx_http_push_stream_convert_char_to_msg_on_shared_locked
(
NGX_
PUSH_STREAM_PING_MESSAGE_TEXT
.
data
,
NGX_PUSH_STREAM_PING_MESSAGE_TEXT
.
len
,
NULL
,
NGX
_PUSH_STREAM_PING_MESSAGE_ID
,
ngx_cycle
->
pool
);
ngx_http_push_stream_ping_msg
=
ngx_http_push_stream_convert_char_to_msg_on_shared_locked
(
NGX_
HTTP_PUSH_STREAM_PING_MESSAGE_TEXT
.
data
,
NGX_HTTP_PUSH_STREAM_PING_MESSAGE_TEXT
.
len
,
NULL
,
NGX_HTTP
_PUSH_STREAM_PING_MESSAGE_ID
,
ngx_cycle
->
pool
);
if
(
ngx_http_push_stream_ping_msg
==
NULL
)
{
return
NGX_ERROR
;
}
...
...
src/ngx_http_push_stream_module_subscriber.c
View file @
bf35d0f9
...
...
@@ -271,7 +271,7 @@ ngx_http_push_stream_subscriber_assign_channel(ngx_slab_pool_t *shpool, ngx_http
if
(
start
==
0
)
{
ngx_str_t
*
str
=
ngx_http_push_stream_get_formatted_message
(
r
,
channel
,
message
,
r
->
pool
);
if
(
str
!=
NULL
)
{
ngx_http_push_stream_send_response_
chunk
(
r
,
str
->
data
,
str
->
len
,
0
);
ngx_http_push_stream_send_response_
text
(
r
,
str
->
data
,
str
->
len
,
0
);
}
qtd
--
;
...
...
src/ngx_http_push_stream_module_utils.c
View file @
bf35d0f9
...
...
@@ -164,19 +164,19 @@ ngx_http_push_stream_send_response_content_header(ngx_http_request_t *r, ngx_htt
ngx_int_t
rc
=
NGX_OK
;
if
(
pslcf
->
header_template
.
len
>
0
)
{
rc
=
ngx_http_push_stream_send_response_
chunk
(
r
,
pslcf
->
header_template
.
data
,
pslcf
->
header_template
.
len
,
0
);
rc
=
ngx_http_push_stream_send_response_
text
(
r
,
pslcf
->
header_template
.
data
,
pslcf
->
header_template
.
len
,
0
);
}
return
rc
;
}
static
ngx_int_t
ngx_http_push_stream_send_response_
chunk
(
ngx_http_request_t
*
r
,
const
u_char
*
chunk_text
,
uint
chunk_
len
,
ngx_flag_t
last_buffer
)
ngx_http_push_stream_send_response_
text
(
ngx_http_request_t
*
r
,
const
u_char
*
text
,
uint
len
,
ngx_flag_t
last_buffer
)
{
ngx_buf_t
*
b
;
ngx_chain_t
*
out
;
if
(
chunk_
text
==
NULL
)
{
if
(
text
==
NULL
)
{
return
NGX_ERROR
;
}
...
...
@@ -189,9 +189,9 @@ ngx_http_push_stream_send_response_chunk(ngx_http_request_t *r, const u_char *ch
b
->
last_buf
=
last_buffer
;
b
->
flush
=
1
;
b
->
memory
=
1
;
b
->
pos
=
(
u_char
*
)
chunk_
text
;
b
->
pos
=
(
u_char
*
)
text
;
b
->
start
=
b
->
pos
;
b
->
end
=
b
->
pos
+
chunk_
len
;
b
->
end
=
b
->
pos
+
len
;
b
->
last
=
b
->
end
;
out
->
buf
=
b
;
...
...
@@ -592,9 +592,9 @@ ngx_http_push_stream_format_message(ngx_http_push_stream_channel_t *channel, ngx
u_char
char_id
[
NGX_INT_T_LEN
];
ngx_memset
(
char_id
,
'\0'
,
NGX_INT_T_LEN
);
u_char
*
msg
=
NGX_PUSH_STREAM_PING_MESSAGE_TEXT
.
data
;
u_char
*
channel_id
=
NGX_PUSH_STREAM_PING_CHANNEL_ID
.
data
;
ngx_int_t
message_id
=
NGX_PUSH_STREAM_PING_MESSAGE_ID
;
u_char
*
msg
=
NGX_
HTTP_
PUSH_STREAM_PING_MESSAGE_TEXT
.
data
;
u_char
*
channel_id
=
NGX_
HTTP_
PUSH_STREAM_PING_CHANNEL_ID
.
data
;
ngx_int_t
message_id
=
NGX_
HTTP_
PUSH_STREAM_PING_MESSAGE_ID
;
if
(
channel
!=
NULL
)
{
channel_id
=
channel
->
id
.
data
;
...
...
@@ -610,9 +610,9 @@ ngx_http_push_stream_format_message(ngx_http_push_stream_channel_t *channel, ngx
ngx_sprintf
(
char_id
,
"%d"
,
message_id
);
txt
=
ngx_http_push_stream_str_replace
(
template
,
NGX_PUSH_STREAM_TOKEN_MESSAGE_ID
.
data
,
char_id
,
0
,
pool
);
txt
=
ngx_http_push_stream_str_replace
(
txt
,
NGX_PUSH_STREAM_TOKEN_MESSAGE_CHANNEL
.
data
,
channel_id
,
0
,
pool
);
txt
=
ngx_http_push_stream_str_replace
(
txt
,
NGX_PUSH_STREAM_TOKEN_MESSAGE_TEXT
.
data
,
msg
,
0
,
pool
);
txt
=
ngx_http_push_stream_str_replace
(
template
,
NGX_
HTTP_
PUSH_STREAM_TOKEN_MESSAGE_ID
.
data
,
char_id
,
0
,
pool
);
txt
=
ngx_http_push_stream_str_replace
(
txt
,
NGX_
HTTP_
PUSH_STREAM_TOKEN_MESSAGE_CHANNEL
.
data
,
channel_id
,
0
,
pool
);
txt
=
ngx_http_push_stream_str_replace
(
txt
,
NGX_
HTTP_
PUSH_STREAM_TOKEN_MESSAGE_TEXT
.
data
,
msg
,
0
,
pool
);
}
else
if
(
message
!=
NULL
)
{
ngx_str_t
msg
=
ngx_string
(
message
->
buf
->
pos
);
...
...
@@ -706,7 +706,7 @@ ngx_http_push_stream_get_formatted_current_time(ngx_pool_t *pool)
currenttime
->
data
=
(
u_char
*
)
(
currenttime
+
1
);
ngx_memset
(
currenttime
->
data
,
'\0'
,
20
);
ngx_gmtime
(
ngx_time
(),
&
tm
);
ngx_sprintf
(
currenttime
->
data
,
(
char
*
)
NGX_PUSH_STREAM_DATE_FORMAT_ISO_8601
.
data
,
tm
.
ngx_tm_year
,
tm
.
ngx_tm_mon
,
tm
.
ngx_tm_mday
,
tm
.
ngx_tm_hour
,
tm
.
ngx_tm_min
,
tm
.
ngx_tm_sec
);
ngx_sprintf
(
currenttime
->
data
,
(
char
*
)
NGX_
HTTP_
PUSH_STREAM_DATE_FORMAT_ISO_8601
.
data
,
tm
.
ngx_tm_year
,
tm
.
ngx_tm_mon
,
tm
.
ngx_tm_mday
,
tm
.
ngx_tm_hour
,
tm
.
ngx_tm_min
,
tm
.
ngx_tm_sec
);
currenttime
->
len
=
ngx_strlen
(
currenttime
->
data
);
}
else
{
currenttime
=
&
NGX_HTTP_PUSH_STREAM_EMPTY
;
...
...
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