Commit 51356e56 authored by Wandenberg's avatar Wandenberg

ensure all queue members are initialized to not produce errors on calling...

ensure all queue members are initialized to not produce errors on calling remove function, without insert them on a queue
parent 467376d3
......@@ -465,7 +465,7 @@ ngx_http_push_stream_broadcast(ngx_http_push_stream_channel_t *channel, ngx_http
}
}
if ((msg->queue.prev == NULL) && (msg->queue.next == NULL)) {
if (ngx_queue_empty(&msg->queue)) {
ngx_shmtx_lock(&shpool->mutex);
ngx_http_push_stream_mark_message_to_delete_locked(msg, mcf->shm_data);
ngx_shmtx_unlock(&shpool->mutex);
......
......@@ -417,6 +417,7 @@ ngx_http_push_stream_subscriber_prepare_request_to_keep_connected(ngx_http_reque
return NULL;
}
ngx_queue_init(&worker_subscriber->worker_queue);
worker_subscriber->longpolling = 0;
worker_subscriber->request = r;
worker_subscriber->worker_subscribed_pid = ngx_pid;
......@@ -629,6 +630,8 @@ ngx_http_push_stream_create_channel_subscription(ngx_http_request_t *r, ngx_http
subscription->channel = channel;
subscription->subscriber = subscriber;
ngx_queue_init(&subscription->queue);
ngx_queue_init(&subscription->channel_worker_queue);
return subscription;
}
......
......@@ -251,13 +251,12 @@ ngx_http_push_stream_convert_char_to_msg_on_shared_locked(ngx_http_push_stream_m
msg->formatted_messages = NULL;
msg->deleted = 0;
msg->expires = 0;
msg->queue.prev = NULL;
msg->queue.next = NULL;
msg->id = id;
msg->workers_ref_count = 0;
msg->time = (id < 0) ? 0 : ngx_time();
msg->tag = (id < 0) ? 0 : ((msg->time == shm_data->last_message_time) ? (shm_data->last_message_tag + 1) : 1);
msg->qtd_templates = mcf->qtd_templates;
ngx_queue_init(&msg->queue);
if ((msg->raw.data = ngx_slab_alloc_locked(shpool, len + 1)) == NULL) {
ngx_http_push_stream_free_message_memory_locked(shpool, msg);
......
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