From 07e5f88368aa97baf8b12d26573521a6ea112d8d Mon Sep 17 00:00:00 2001
From: winckel <winckel@eurecom.fr>
Date: Fri, 24 Jan 2014 23:21:15 +0000
Subject: [PATCH] Removed set title for socket thread.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4945 818b1a75-f10b-46b9-bf7c-635c3b92a50f
---
 .../utils/itti_analyzer/libbuffers/socket.c   |  4 ----
 .../utils/itti_analyzer/libui/ui_callbacks.c  | 24 +++++++++++--------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/common/utils/itti_analyzer/libbuffers/socket.c b/common/utils/itti_analyzer/libbuffers/socket.c
index 5c62bdc46..7748965e5 100644
--- a/common/utils/itti_analyzer/libbuffers/socket.c
+++ b/common/utils/itti_analyzer/libbuffers/socket.c
@@ -319,8 +319,6 @@ void *socket_thread_fct(void *arg)
     tv.tv_sec = 0;
     tv.tv_usec = 1000 * SOCKET_MS_BEFORE_SIGNALLING;
 
-    ui_set_title ("connecting to %s:%d ...", socket_data->ip_address, socket_data->port);
-
     do {
         /* Connecting to remote peer */
         ret = connect(socket_data->sd, (struct sockaddr *) &si_me, sizeof(struct sockaddr_in));
@@ -340,8 +338,6 @@ void *socket_thread_fct(void *arg)
         }
     } while (ret < 0);
 
-    ui_set_title ("%s:%d", socket_data->ip_address, socket_data->port);
-
     /* Set the socket as non-blocking */
     fcntl(socket_data->sd, F_SETFL, O_NONBLOCK);
 
diff --git a/common/utils/itti_analyzer/libui/ui_callbacks.c b/common/utils/itti_analyzer/libui/ui_callbacks.c
index d4228f366..72033c292 100644
--- a/common/utils/itti_analyzer/libui/ui_callbacks.c
+++ b/common/utils/itti_analyzer/libui/ui_callbacks.c
@@ -33,6 +33,9 @@ static gboolean refresh_message_list =  TRUE;
 static gboolean filters_changed =       FALSE;
 static gboolean operation_running =     FALSE;
 
+static const char *ui_ip;
+static uint16_t ui_port;
+
 gboolean ui_callback_on_open_messages(GtkWidget *widget, gpointer data)
 {
     gboolean refresh = (data != NULL) ? TRUE : FALSE;
@@ -551,6 +554,7 @@ gboolean ui_pipe_callback(gint source, gpointer user_data)
             return ui_handle_socket_connection_lost (source);
 
         case UI_PIPE_XML_DEFINITION:
+            ui_set_title ("%s:%d", ui_ip, ui_port);
             return ui_handle_socket_xml_definition (source, input_data, input_data_length);
 
         case UI_PIPE_UPDATE_SIGNAL_LIST:
@@ -565,25 +569,23 @@ gboolean ui_pipe_callback(gint source, gpointer user_data)
 
 gboolean ui_callback_on_connect(GtkWidget *widget, gpointer data)
 {
-    /* We have to retrieve the ip address and port of remote host */
-    const char *ip;
-    uint16_t port;
+    /* We have to retrieve the ip address and ui_port of remote host */
     int pipe_fd[2];
 
-    port = atoi (gtk_entry_get_text (GTK_ENTRY(ui_main_data.port_entry)));
-    ip = gtk_entry_get_text (GTK_ENTRY(ui_main_data.ip_entry));
+    ui_port = atoi (gtk_entry_get_text (GTK_ENTRY(ui_main_data.port_entry)));
+    ui_ip = gtk_entry_get_text (GTK_ENTRY(ui_main_data.ip_entry));
 
-    g_message("Connect event occurred to %s:%d", ip, port);
+    g_message("Connect event occurred to %s:%d", ui_ip, ui_port);
 
-    if (strlen (ip) == 0)
+    if (strlen (ui_ip) == 0)
     {
         ui_notification_dialog (GTK_MESSAGE_ERROR, FALSE, "Connect", "Empty host ip address");
         return FALSE;
     }
 
-    if (port == 0)
+    if (ui_port == 0)
     {
-        ui_notification_dialog (GTK_MESSAGE_ERROR, FALSE, "Connect", "Invalid host port value");
+        ui_notification_dialog (GTK_MESSAGE_ERROR, FALSE, "Connect", "Invalid host ui_port value");
         return FALSE;
     }
 
@@ -601,7 +603,9 @@ gboolean ui_callback_on_connect(GtkWidget *widget, gpointer data)
 
         ui_callback_signal_clear_list (widget, data);
 
-        if (socket_connect_to_remote_host (ip, port, pipe_fd[1]) != 0)
+        ui_set_title ("connecting to %s:%d ...", ui_ip, ui_port);
+
+        if (socket_connect_to_remote_host (ui_ip, ui_port, pipe_fd[1]) != 0)
         {
             ui_enable_connect_button ();
             operation_running = FALSE;
-- 
GitLab