Commit 7e70cc1c authored by Wandenberg Peixoto's avatar Wandenberg Peixoto

changing the syntax of calls to ngx_rbtree_delete and ngx_rbtree_insert...

changing the syntax of calls to ngx_rbtree_delete and ngx_rbtree_insert methods, to not use type casting
parent 87e5ecd8
...@@ -674,9 +674,9 @@ ngx_http_push_stream_delete_channel(ngx_str_t *id, ngx_pool_t *temp_pool) ...@@ -674,9 +674,9 @@ ngx_http_push_stream_delete_channel(ngx_str_t *id, ngx_pool_t *temp_pool)
(channel->broadcast) ? NGX_HTTP_PUSH_STREAM_DECREMENT_COUNTER(data->broadcast_channels) : NGX_HTTP_PUSH_STREAM_DECREMENT_COUNTER(data->channels); (channel->broadcast) ? NGX_HTTP_PUSH_STREAM_DECREMENT_COUNTER(data->broadcast_channels) : NGX_HTTP_PUSH_STREAM_DECREMENT_COUNTER(data->channels);
// move the channel to unrecoverable tree // move the channel to unrecoverable tree
ngx_rbtree_delete(&data->tree, (ngx_rbtree_node_t *) channel); ngx_rbtree_delete(&data->tree, &channel->node);
channel->node.key = ngx_crc32_short(channel->id.data, channel->id.len); channel->node.key = ngx_crc32_short(channel->id.data, channel->id.len);
ngx_rbtree_insert(&data->unrecoverable_channels, (ngx_rbtree_node_t *) channel); ngx_rbtree_insert(&data->unrecoverable_channels, &channel->node);
// remove all messages // remove all messages
...@@ -729,9 +729,9 @@ ngx_http_push_stream_collect_expired_messages_and_empty_channels(ngx_http_push_s ...@@ -729,9 +729,9 @@ ngx_http_push_stream_collect_expired_messages_and_empty_channels(ngx_http_push_s
(channel->broadcast) ? NGX_HTTP_PUSH_STREAM_DECREMENT_COUNTER(data->broadcast_channels) : NGX_HTTP_PUSH_STREAM_DECREMENT_COUNTER(data->channels); (channel->broadcast) ? NGX_HTTP_PUSH_STREAM_DECREMENT_COUNTER(data->broadcast_channels) : NGX_HTTP_PUSH_STREAM_DECREMENT_COUNTER(data->channels);
// move the channel to trash tree // move the channel to trash tree
ngx_rbtree_delete(&data->tree, (ngx_rbtree_node_t *) channel); ngx_rbtree_delete(&data->tree, &channel->node);
channel->node.key = ngx_crc32_short(channel->id.data, channel->id.len); channel->node.key = ngx_crc32_short(channel->id.data, channel->id.len);
ngx_rbtree_insert(&data->channels_to_delete, (ngx_rbtree_node_t *) channel); ngx_rbtree_insert(&data->channels_to_delete, &channel->node);
} }
} }
......
...@@ -90,7 +90,7 @@ ngx_http_push_stream_initialize_channel(ngx_http_push_stream_channel_t *channel) ...@@ -90,7 +90,7 @@ ngx_http_push_stream_initialize_channel(ngx_http_push_stream_channel_t *channel)
channel->message_queue.deleted = 0; channel->message_queue.deleted = 0;
channel->node.key = ngx_crc32_short(channel->id.data, channel->id.len); channel->node.key = ngx_crc32_short(channel->id.data, channel->id.len);
ngx_rbtree_insert(&data->tree, (ngx_rbtree_node_t *) channel); ngx_rbtree_insert(&data->tree, &channel->node);
(channel->broadcast) ? data->broadcast_channels++ : data->channels++; (channel->broadcast) ? data->broadcast_channels++ : data->channels++;
} }
...@@ -121,7 +121,7 @@ ngx_http_push_stream_find_channel(ngx_str_t *id, ngx_log_t *log) ...@@ -121,7 +121,7 @@ ngx_http_push_stream_find_channel(ngx_str_t *id, ngx_log_t *log)
channel = ngx_http_push_stream_find_channel_on_tree(id, log, &data->channels_to_delete); channel = ngx_http_push_stream_find_channel_on_tree(id, log, &data->channels_to_delete);
if (channel != NULL) { if (channel != NULL) {
// move the channel back to main tree (recover from trash) // move the channel back to main tree (recover from trash)
ngx_rbtree_delete(&data->channels_to_delete, (ngx_rbtree_node_t *) channel); ngx_rbtree_delete(&data->channels_to_delete, &channel->node);
ngx_http_push_stream_initialize_channel(channel); ngx_http_push_stream_initialize_channel(channel);
} }
...@@ -154,7 +154,7 @@ ngx_http_push_stream_find_channel_locked(ngx_str_t *id, ngx_log_t *log) ...@@ -154,7 +154,7 @@ ngx_http_push_stream_find_channel_locked(ngx_str_t *id, ngx_log_t *log)
channel = ngx_http_push_stream_find_channel_on_tree(id, log, &data->channels_to_delete); channel = ngx_http_push_stream_find_channel_on_tree(id, log, &data->channels_to_delete);
if (channel != NULL) { if (channel != NULL) {
// move the channel back to main tree (recover from trash) // move the channel back to main tree (recover from trash)
ngx_rbtree_delete(&data->channels_to_delete, (ngx_rbtree_node_t *) channel); ngx_rbtree_delete(&data->channels_to_delete, &channel->node);
ngx_http_push_stream_initialize_channel(channel); ngx_http_push_stream_initialize_channel(channel);
} }
} }
......
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