Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] On Copy as Filter

From: didier <dgautheron@xxxxxxxx>
Date: Sat, 06 Jun 2009 15:29:01 +0200
Hi,
Le vendredi 05 juin 2009 ᅵ 17:26 -0700, Guy Harris a ᅵcrit :
> On Jun 5, 2009, at 4:29 PM, didier wrote:

> This would presumably be combined with a complete removal of the  
> col_expr field from the frame_data structure, right?
Yes absolutely but for testing purpose this patch is a lot smaller and
doesn't trigger a full recompilation.

A drawback is that it's slower and can sleep. 
It's no great with X if it has a server grab (called from a popup?). 

> 
> Actually, get_filter_from_packet_list_row_and_column() (I renamed the  
> function from get_text_from_packet_list() to indicate in more detail  
> what it does - it doesn't fetch arbitrary text, it fetches a filter  
> expression) is called only by match_selected_plist_cb(), which passes  
> it to match_selected_cb_do(), which always uses it to make a copy, so  
> if we just had get_filter_from_packet_list_row_and_column() create the  
> string with g_strdup_printf() and changed match_selected_plist_cb() to
> 
> 	char *filter_text;
> 
> 	filter_text = get_filter_from_packet_list_row_and_column(data);
> 	match_selected_cb_do(data, action, filter_text);
> 	g_free(filter_text);
> 
> (or incorporated get_filter_from_packet_list_row_and_column() into  
> match_selected_plist_cb()), that would mean that we wouldn't have to  
> worry about ephemeral vs. per-session strings.
> 
Didier