MQTT: Prevent subsequent messages from overwriting the Info column

Without a fence col_add_fstr will overwrite the whole column on each
message.
Instead of adding a fence and adding the message info use
col_append_sep_str which also supports a separator out of the box.
e.g. "Connect Command, Publish Message, Disconnect Req"

Change-Id: I346d9b659a044143cd31f08081ad145b9186307c
Signed-off-by: Alexander Stein <alexanders83@web.de>
Reviewed-on: https://code.wireshark.org/review/7771
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Alexander Stein 2015-03-20 20:24:34 +01:00 committed by Michael Mann
parent 2afb52461c
commit 6c38340789
1 changed files with 3 additions and 1 deletions

View File

@ -192,7 +192,7 @@ static int dissect_mqtt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
mqtt_msg_type = mqtt_fixed_hdr >> 4;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "MQTT");
col_add_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str_ext(mqtt_msg_type, &mqtt_msgtype_vals_ext, "Unknown (0x%02x)"));
col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", val_to_str_ext(mqtt_msg_type, &mqtt_msgtype_vals_ext, "Unknown (0x%02x)"));
if(tree)
{
@ -435,6 +435,8 @@ XXX: ToDo: Commit a fix for the case of the length field spread across TCP segme
static int dissect_mqtt_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
col_clear(pinfo->cinfo, COL_INFO);
tcp_dissect_pdus(tvb, pinfo, tree,
reassemble_mqtt_over_tcp,
2, /* Length can be determined within 5 bytes */