rsync: improved info for protocol.

Change-Id: I9d1ae0bf1d6df0b9da0220aeff2dd73b5f18f38a
Reviewed-on: https://code.wireshark.org/review/7407
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Dario Lombardo 2015-02-26 11:03:21 +01:00 committed by Michael Mann
parent bcf870e2af
commit 354691449b
1 changed files with 7 additions and 1 deletions

View File

@ -125,12 +125,18 @@ dissect_rsync_version_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *rsyn
{
int offset = 0;
guint8 *version;
guint len;
proto_tree_add_item(rsync_tree, &hfi_rsync_hdr_magic, tvb, offset, RSYNCD_MAGIC_HEADER_LEN, ENC_ASCII|ENC_NA);
offset += RSYNCD_MAGIC_HEADER_LEN;
offset += 1; /* skip the space */
proto_tree_add_item(rsync_tree, &hfi_rsync_hdr_version, tvb, offset, -1, ENC_ASCII|ENC_NA);
version = tvb_get_string_enc(wmem_packet_scope(),tvb, offset, tvb_reported_length_remaining(tvb, offset), ENC_ASCII|ENC_NA);
len = tvb_reported_length_remaining(tvb, offset);
version = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len, ENC_ASCII|ENC_NA);
/* VERSION string can contain undesirable char (like \n) at the end. Trim it. */
if (len > 0 && version[len - 1] == '\n')
version[len - 1] = 0x0;
col_add_fstr(pinfo->cinfo, COL_INFO, "%s Initialisation (Version %s)", (me == SERVER ? "Server" : "Client"), version);
}