Commit 89e924c6 authored by Wandenberg Peixoto's avatar Wandenberg Peixoto

renaming type ngx_http_push_stream_msg_template_t to ngx_http_push_stream_template_queue_t

parent 8af92c96
...@@ -36,7 +36,7 @@ typedef struct { ...@@ -36,7 +36,7 @@ typedef struct {
ngx_queue_t queue; // this MUST be first ngx_queue_t queue; // this MUST be first
ngx_str_t template; ngx_str_t template;
ngx_uint_t index; ngx_uint_t index;
} ngx_http_push_stream_msg_template_t; } ngx_http_push_stream_template_queue_t;
typedef struct { typedef struct {
size_t shm_size; size_t shm_size;
...@@ -45,7 +45,7 @@ typedef struct { ...@@ -45,7 +45,7 @@ typedef struct {
ngx_str_t channel_deleted_message_text; ngx_str_t channel_deleted_message_text;
ngx_str_t ping_message_text; ngx_str_t ping_message_text;
ngx_uint_t qtd_templates; ngx_uint_t qtd_templates;
ngx_http_push_stream_msg_template_t msg_templates; ngx_http_push_stream_template_queue_t msg_templates;
} ngx_http_push_stream_main_conf_t; } ngx_http_push_stream_main_conf_t;
typedef struct { typedef struct {
......
...@@ -311,11 +311,11 @@ ngx_http_push_stream_send_response_all_channels_info_detailed(ngx_http_request_t ...@@ -311,11 +311,11 @@ ngx_http_push_stream_send_response_all_channels_info_detailed(ngx_http_request_t
static ngx_int_t static ngx_int_t
ngx_http_push_stream_find_or_add_template(ngx_conf_t *cf, ngx_str_t template) { ngx_http_push_stream_find_or_add_template(ngx_conf_t *cf, ngx_str_t template) {
ngx_http_push_stream_msg_template_t *sentinel = &ngx_http_push_stream_module_main_conf->msg_templates; ngx_http_push_stream_template_queue_t *sentinel = &ngx_http_push_stream_module_main_conf->msg_templates;
ngx_http_push_stream_msg_template_t *cur = sentinel; ngx_http_push_stream_template_queue_t *cur = sentinel;
u_char *aux = NULL; u_char *aux = NULL;
while ((cur = (ngx_http_push_stream_msg_template_t *) ngx_queue_next(&cur->queue)) != sentinel) { while ((cur = (ngx_http_push_stream_template_queue_t *) ngx_queue_next(&cur->queue)) != sentinel) {
if (ngx_memn2cmp(cur->template.data, template.data, cur->template.len, template.len) == 0) { if (ngx_memn2cmp(cur->template.data, template.data, cur->template.len, template.len) == 0) {
return cur->index; return cur->index;
} }
...@@ -323,7 +323,7 @@ ngx_http_push_stream_find_or_add_template(ngx_conf_t *cf, ngx_str_t template) { ...@@ -323,7 +323,7 @@ ngx_http_push_stream_find_or_add_template(ngx_conf_t *cf, ngx_str_t template) {
ngx_http_push_stream_module_main_conf->qtd_templates++; ngx_http_push_stream_module_main_conf->qtd_templates++;
cur = ngx_pcalloc(cf->pool, sizeof(ngx_http_push_stream_msg_template_t)); cur = ngx_pcalloc(cf->pool, sizeof(ngx_http_push_stream_template_queue_t));
aux = ngx_pcalloc(cf->pool, template.len + 1); aux = ngx_pcalloc(cf->pool, template.len + 1);
if ((cur == NULL) || (aux == NULL)) { if ((cur == NULL) || (aux == NULL)) {
ngx_log_error(NGX_LOG_ERR, cf->log, 0, "push stream module: unable to allocate memory for add template to main configuration"); ngx_log_error(NGX_LOG_ERR, cf->log, 0, "push stream module: unable to allocate memory for add template to main configuration");
......
...@@ -137,8 +137,8 @@ ngx_http_push_stream_msg_t * ...@@ -137,8 +137,8 @@ ngx_http_push_stream_msg_t *
ngx_http_push_stream_convert_char_to_msg_on_shared_locked(u_char *data, size_t len, ngx_http_push_stream_channel_t *channel, ngx_int_t id, ngx_pool_t *temp_pool) ngx_http_push_stream_convert_char_to_msg_on_shared_locked(u_char *data, size_t len, ngx_http_push_stream_channel_t *channel, ngx_int_t id, ngx_pool_t *temp_pool)
{ {
ngx_slab_pool_t *shpool = (ngx_slab_pool_t *) ngx_http_push_stream_shm_zone->shm.addr; ngx_slab_pool_t *shpool = (ngx_slab_pool_t *) ngx_http_push_stream_shm_zone->shm.addr;
ngx_http_push_stream_msg_template_t *sentinel = &ngx_http_push_stream_module_main_conf->msg_templates; ngx_http_push_stream_template_queue_t *sentinel = &ngx_http_push_stream_module_main_conf->msg_templates;
ngx_http_push_stream_msg_template_t *cur = sentinel; ngx_http_push_stream_template_queue_t *cur = sentinel;
ngx_http_push_stream_msg_t *msg; ngx_http_push_stream_msg_t *msg;
int i = 0; int i = 0;
...@@ -178,7 +178,7 @@ ngx_http_push_stream_convert_char_to_msg_on_shared_locked(u_char *data, size_t l ...@@ -178,7 +178,7 @@ ngx_http_push_stream_convert_char_to_msg_on_shared_locked(u_char *data, size_t l
msg->raw.len = len; msg->raw.len = len;
msg->formatted_messages = ngx_slab_alloc_locked(shpool, sizeof(ngx_str_t)*ngx_http_push_stream_module_main_conf->qtd_templates); msg->formatted_messages = ngx_slab_alloc_locked(shpool, sizeof(ngx_str_t)*ngx_http_push_stream_module_main_conf->qtd_templates);
while ((cur = (ngx_http_push_stream_msg_template_t *) ngx_queue_next(&cur->queue)) != sentinel) { while ((cur = (ngx_http_push_stream_template_queue_t *) ngx_queue_next(&cur->queue)) != sentinel) {
ngx_str_t *aux = ngx_http_push_stream_format_message(channel, msg, cur->template, temp_pool); ngx_str_t *aux = ngx_http_push_stream_format_message(channel, msg, cur->template, temp_pool);
ngx_str_t *chunk = ngx_http_push_stream_get_formatted_chunk(aux->data, aux->len, temp_pool); ngx_str_t *chunk = ngx_http_push_stream_get_formatted_chunk(aux->data, aux->len, temp_pool);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment