Wireshark-bugs: [Wireshark-bugs] [Bug 5749] Improve Connection Manager and Connection Configurat
Date: Mon, 25 Apr 2011 18:54:26 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5749

--- Comment #6 from Jeff Morriss <jeff.morriss.ws@xxxxxxxxx> 2011-04-25 18:54:25 PDT ---
Some comments:

Why all the proto_tree_add_text()s?  Shouldn't those be filterable fields
(added with proto_tree_add_item())?  As it says in README.developer,
proto_tree_add_text() should normally be avoided.

Shouldn't some of this dissection be broken down into subroutines? There are
now three 700+ line functions.  Then again, use of add_item() may shorten those
functions substantially...  This would also help eliminate the need to indent
code that is adding things to a subtree.  That is, you shouldn't have to resort
to that to make the code readable.

Also: doing:

if (tvb_get_guint8(tvb, offset) == XXX)
[...]
else if (tvb_get_guint8(tvb, offset) == YYY)
[...]
else if (tvb_get_guint8(tvb_offset) == ZZZ)

would be better done with a variable or maybe even another switch statement. 
(I suppose the compiler will be smart enough to put it in a variable for you,
but it still could be more readable.)

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.