Update the comments/warnings about using proto_tree_append_string().

packet-wsp.c hasn't used proto_tree_append_string() since
Ic5467289aae7d54e78c1fd65f93358387d6139aa.  Use packet-frame as the example
instead.

Change-Id: I69fb10679ec1685a61aac182414e596b345153fd
Reviewed-on: https://code.wireshark.org/review/15563
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Jeff Morriss 2016-05-25 18:06:37 -04:00 committed by Anders Broman
parent 0bc1cdd9f3
commit aaa5551346
2 changed files with 17 additions and 16 deletions

View File

@ -3535,17 +3535,18 @@ proto_tree_add_string_format(proto_tree *tree, int hfindex, tvbuff_t *tvb,
* allowing progressive field info update instead of only updating the
* representation as does proto_item_append_text()
*/
/* NOTE: this function will break with the TRY_TO_FAKE_THIS_ITEM()
* speed optimization.
* Currently only WSP use this function so it is not that bad but try to
* avoid using this one if possible.
* IF you must use this function you MUST also disable the
* TRY_TO_FAKE_THIS_ITEM() optimization for your dissector/function
* using proto_item_append_string().
* Do that by faking that the tree is visible by calling
* proto_tree_set_visible(tree, TRUE) (see packet-wsp.c)
* BEFORE you create the item you are later going to use
* proto_item_append_string() on.
/*
* NOTE: this function will break with the TRY_TO_FAKE_THIS_ITEM()
* speed optimization.
* Currently only a few dissectors use this function so it is not
* that bad but try to avoid using this one if possible.
* IF you must use this function you MUST also disable the
* TRY_TO_FAKE_THIS_ITEM() optimization for the proto_item you'll be
* appending to with proto_item_append_string().
* Do that by faking that the tree is visible by calling
* proto_tree_set_visible(tree, TRUE) (see packet-frame.c)
* BEFORE you create the item you are later going to use
* proto_item_append_string() on.
*/
void
proto_item_append_string(proto_item *pi, const char *str)

View File

@ -2070,13 +2070,13 @@ proto_tree_add_debug_text(proto_tree *tree, const char *format,
/** Append a string to a protocol item.<br>
NOTE: this function will break with the TRY_TO_FAKE_THIS_ITEM()
speed optimization.
Currently only WSP use this function so it is not that bad but try to
avoid using this one if possible.
Currently only a few dissectors use this function so it is not
that bad but try to avoid using this one if possible.
IF you must use this function you MUST also disable the
TRY_TO_FAKE_THIS_ITEM() optimization for your dissector/function
using proto_item_append_string().
TRY_TO_FAKE_THIS_ITEM() optimization for the proto_item you'll be
appending to with proto_item_append_string().
Do that by faking that the tree is visible by calling
proto_tree_set_visible(tree, TRUE) (see packet-wsp.c)
proto_tree_set_visible(tree, TRUE) (see packet-frame.c)
BEFORE you create the item you are later going to use
proto_item_append_string() on.
@param pi the item to append the string to