diff options
author | Michael Mann <mmann78@netscape.net> | 2016-05-27 11:27:16 -0400 |
---|---|---|
committer | Jeff Morriss <jeff.morriss.ws@gmail.com> | 2016-05-28 01:57:10 +0000 |
commit | 0482b78a8d7dfcff9dcd8f0e9d2950e51601062d (patch) | |
tree | 5971085cfdcadc61c0842e7d72031ba1feb204ba /epan/dissectors/file-file.c | |
parent | 448934152ee55296eeada99cca33f4434a665df1 (diff) |
Set frame/file protocol list only after dissection is complete.
The protocol list tree item used in a frame/file is near the bottom
of items under the frame/file tree. Move it a little farther down until
after the rest of the frame/record is dissected. This prevents the need
for proto_item_append_string (and its special handling)
Change-Id: Iea4eaac7675126ebad642b11fa86ad211f21ae26
Reviewed-on: https://code.wireshark.org/review/15589
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Diffstat (limited to 'epan/dissectors/file-file.c')
-rw-r--r-- | epan/dissectors/file-file.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/epan/dissectors/file-file.c b/epan/dissectors/file-file.c index 5748057558..b75ffc31ae 100644 --- a/epan/dissectors/file-file.c +++ b/epan/dissectors/file-file.c @@ -107,8 +107,6 @@ dissect_file_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, if(!proto_field_is_referenced(tree, proto_file)) { tree=NULL; } else { - gboolean old_visible; - /* Put in frame header information. */ cap_len = tvb_captured_length(tvb); frame_len = tvb_reported_length(tvb); @@ -138,20 +136,6 @@ dissect_file_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, ti = proto_tree_add_boolean(fh_tree, hf_file_ignored, tvb, 0, 0,pinfo->fd->flags.ignored); PROTO_ITEM_SET_GENERATED(ti); - if(proto_field_is_referenced(tree, hf_file_protocols)) { - /* we are going to be using proto_item_append_string() on - * hf_frame_protocols, and we must therefore disable the - * TRY_TO_FAKE_THIS_ITEM() optimisation for the tree by - * setting it as visible. - * - * See proto.h for details. - */ - old_visible = proto_tree_set_visible(fh_tree, TRUE); - ti = proto_tree_add_string(fh_tree, hf_file_protocols, tvb, 0, 0, ""); - PROTO_ITEM_SET_GENERATED(ti); - proto_tree_set_visible(fh_tree, old_visible); - } - if(pinfo->fd->pfd != 0){ proto_item *ppd_item; guint num_entries = g_slist_length(pinfo->fd->pfd); @@ -246,7 +230,8 @@ dissect_file_record(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, wmem_strbuf_append(val, proto_get_protocol_filter_name(GPOINTER_TO_UINT(wmem_list_frame_data(frame)))); frame = wmem_list_frame_next(frame); } - proto_item_append_string(ti, wmem_strbuf_get_str(val)); + ti = proto_tree_add_string(fh_tree, hf_file_protocols, tvb, 0, 0, wmem_strbuf_get_str(val)); + PROTO_ITEM_SET_GENERATED(ti); } /* Call postdissectors if we have any (while trying to avoid another |