diff options
author | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2009-08-15 06:38:10 +0000 |
---|---|---|
committer | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2009-08-15 06:38:10 +0000 |
commit | 7d442624064b470be60a976c9d9ae06069458aac (patch) | |
tree | a46ff02b744f06032eaef2a29c3777ff4d894226 /print.c | |
parent | 3beae5944f126dbaa9a08a9e31cb07b68eac5296 (diff) | |
download | wireshark-7d442624064b470be60a976c9d9ae06069458aac.tar.gz wireshark-7d442624064b470be60a976c9d9ae06069458aac.tar.bz2 wireshark-7d442624064b470be60a976c9d9ae06069458aac.zip |
This patch introduces packet_add_new_data_source() which effectively deprecates add_new_data_source(). This is based on the following observation:
1) The tvb + name (aka. data_source) is only used when the protocol tree is visible
The current implementation of add_new_data_source() doesn't take this into account and simply allocates a data_source regardless. This is what packet_add_new_data_source() tries to rectify.
A couple of dissectors have already been switched over to the new packet_add_new_data_source(). Many are still missing. Help appreciated!
svn path=/trunk/; revision=29427
Diffstat (limited to 'print.c')
-rw-r--r-- | print.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -240,6 +240,10 @@ proto_tree_write_pdml(epan_dissect_t *edt, FILE *fh) data.src_list = edt->pi.data_src; data.edt = edt; + /* We shouldn't be called with a NULL pointer here because we've + * created a visible protocol tree */ + g_assert(data.src_list); + fprintf(fh, "<packet>\n"); /* Print a "geninfo" protocol as required by PDML */ @@ -776,6 +780,10 @@ print_hex_data(print_stream_t *stream, epan_dissect_t *edt) const guchar *cp; guint length; + /* We shouldn't be called with a NULL pointer here because we've + * created a visible protocol tree */ + g_assert(edt->pi.data_src); + /* * Set "multiple_sources" iff this frame has more than one * data source; if it does, we need to print the name of |