aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/export_object_http.c
diff options
context:
space:
mode:
authorsfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>2007-03-13 20:42:04 +0000
committersfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>2007-03-13 20:42:04 +0000
commit4f675bdc08eead419d0f83a18f01a207379ba436 (patch)
treeee787d3b7d85cf9335ea25cd19d10ac228cff5af /gtk/export_object_http.c
parent29bf59039973e94b28d2574d5695eb64d0091857 (diff)
HTTP Export Object updates:
- Split the HTTP tap into two taps: one for the HTTP statistics and the other for the export object function. This allows the HTTP statistics to work again (they seem to have been partially broken since SVN rev 18901). - Pass the conversation data (conv_data) between functions now instead of using the global variable stat_info (now only used for the HTTP stats) - Pass only pointers from the HTTP dissector to the Export Object tap, where we'll then copy the values and insert into the slist. - Make sure we free all memory allocated by this feature when we're done with it. - Various other minor improvements git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21021 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk/export_object_http.c')
-rw-r--r--gtk/export_object_http.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/gtk/export_object_http.c b/gtk/export_object_http.c
index 6ae40ca9c9..2e41065978 100644
--- a/gtk/export_object_http.c
+++ b/gtk/export_object_http.c
@@ -47,22 +47,25 @@ eo_http_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_,
const void *data)
{
export_object_list_t *object_list = tapdata;
- const http_info_value_t *stat_info = data;
+ const http_eo_t *eo_info = data;
export_object_entry_t *entry;
- if(stat_info->content_type && /* We have data waiting for us */
- g_ascii_strncasecmp(stat_info->content_type, "<NULL>", 6) != 0) {
- entry = g_malloc(sizeof(export_object_entry_t));
-
+ if(eo_info) { /* We have data waiting for us */
+ /* These values will be freed when the Export Object window
+ * is closed. */
+ entry = g_malloc(sizeof(export_object_entry_t));
+
entry->pkt_num = pinfo->fd->num;
- entry->hostname = stat_info->http_host;
- entry->content_type = stat_info->content_type;
- entry->filename = g_path_get_basename(stat_info->request_uri);
- entry->payload_len = stat_info->payload_len;
- entry->payload_data = stat_info->payload_data;
+ entry->hostname = g_strdup(eo_info->hostname);
+ entry->content_type = g_strdup(eo_info->content_type);
+ entry->filename = g_strdup(g_path_get_basename(eo_info->filename));
+ entry->payload_len = eo_info->payload_len;
+ entry->payload_data = g_memdup(eo_info->payload_data,
+ eo_info->payload_len);
object_list->entries =
g_slist_append(object_list->entries, entry);
+
return 1; /* State changed - window should be redrawn */
} else {
return 0; /* State unchanged - no window updates needed */
@@ -72,7 +75,7 @@ eo_http_packet(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_,
void
eo_http_cb(GtkWidget *widget _U_, gpointer data _U_)
{
- export_object_window("http", eo_http_packet);
+ export_object_window("http_eo", "HTTP", eo_http_packet);
}
#endif /* GTK_MAJOR_VERSION >= 2 */