Ethereal-dev: Re: [Ethereal-dev] [bug] conversation, endpoint clist (menu statistics).

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: didier <dgautheron@xxxxxxxx>
Date: Tue, 08 Mar 2005 10:20:46 +0000
ronnie sahlberg wrote:
thaw/freeze was used to protect a critical section of the code if the
_draw() and also the _reset() was called at the same time. so that the
linked list of tap listners would not change dangerously from
underneath someone walking the list.

This can no longer happen since we are not using pthreads any more.
(pthreads performed very poorly when it was used).
Then remove it or fix it :)
With gtk1 for at least conversation and hostlist in init_xxx_table:
cf_retap_packet, for a big enough capture, calls draw_ct_table_data and the next gtk_clist_freeze() blocks all refresh, for example in Statistics->Endpoint list->IPv4 column sort doesn't always work. Moreover after a popup menu the list isn't refreshed, again only tested with gtk1.

Attached a patch against hostlist_table.c but I'm not sure it's the right thing to do.

Didier

Index: hostlist_table.c
===================================================================
--- hostlist_table.c	(revision 13650)
+++ hostlist_table.c	(working copy)
@@ -388,11 +388,15 @@
                                           (gint) (((GdkEventButton *)event)->x),
                                           (gint) (((GdkEventButton *)event)->y),
                                              &row, &column)) {
+	
             gtk_clist_unselect_all(et->table);
             gtk_clist_select_row(et->table, row, -1);
+            gtk_clist_thaw(et->table);
 
             gtk_menu_popup(GTK_MENU(et->menu), NULL, NULL, NULL, NULL,
                 bevent->button, bevent->time);
+            gtk_clist_freeze(et->table);
+
         }
     }
 
@@ -639,6 +643,9 @@
     gtk_box_pack_start(GTK_BOX(vbox), hosttable->scrolled_window, TRUE, TRUE, 0);
 
     hosttable->table=(GtkCList *)gtk_clist_new(NUM_COLS);
+    /* Keep clist frozen to cause modifications to the clist (inserts, appends, others that are extremely slow
+	   in GTK2) to not be drawn, allow refreshes to occur at strategic points for performance */
+    gtk_clist_freeze(hosttable->table);
 
     col_arrows = (column_arrows *) g_malloc(sizeof(column_arrows) * NUM_COLS);
     win_style = gtk_widget_get_style(hosttable->scrolled_window);
@@ -768,11 +775,6 @@
 
     cf_retap_packets(&cfile);
 	
-    /* Keep clist frozen to cause modifications to the clist (inserts, appends, others that are extremely slow
-	   in GTK2) to not be drawn, allow refreshes to occur at strategic points for performance */
-  	gtk_clist_freeze(hosttable->table);
-
-
     /* after retapping, redraw table */
     draw_hostlist_table_data(hosttable);
 }