Commit c0ec1351 authored by winckel's avatar winckel

Added the flag itti_dump_running to stop enqueuing messages when exiting the ITTI dump thread.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4533 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 2ee4242d
......@@ -134,6 +134,7 @@ typedef struct {
static itti_desc_t itti_dump_queue;
static FILE *dump_file;
static int itti_dump_running = 1;
static int itti_dump_send_message(int sd, itti_dump_queue_item_t *message);
static int itti_dump_handle_new_connection(int sd, const char *xml_definition,
......@@ -276,6 +277,8 @@ int itti_dump_queue_message(message_number_t message_number,
const char *message_name,
const uint32_t message_size)
{
if (itti_dump_running)
{
itti_dump_queue_item_t *new;
size_t message_name_length;
int i;
......@@ -314,6 +317,7 @@ int itti_dump_queue_message(message_number_t message_number,
continue;
itti_dump_send_message(itti_dump_queue.itti_clients[i].sd, new);
}
}
return 0;
}
......@@ -699,6 +703,9 @@ void itti_dump_exit(void)
new = calloc(1, sizeof(itti_dump_queue_item_t));
/* Set a flag to stop recording message */
itti_dump_running = 0;
/* Send the exit signal to other thread */
itti_dump_enqueue_message(new, 0, ITTI_DUMP_EXIT_SIGNAL);
......
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