aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ftp.c
diff options
context:
space:
mode:
authorMartin Mathieson <martin.r.mathieson@googlemail.com>2012-07-22 04:44:16 +0000
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2012-07-22 04:44:16 +0000
commit7abae044781e32c8e469d91121f907188d77fc9e (patch)
tree29fbcc74168dff10709d3adaf76e40da8f933861 /epan/dissectors/packet-ftp.c
parent0d4eafb04d7f80c23a7db68c27f2b7add1f69f94 (diff)
Calling tvb_format_text() for binary data segments (c1400 bytes) was
*very* slow (in a profiled run where FTP data is carried over LTE MAC/RLC/PDCP/IP/TCP, this one function call was 20% of overall runtime). Have limited to call to ITEM_LABEL_LENGTH, as that is all that will be displayed anyway. As per comment, I'm not convinced that doing this for binary FTP data segments is worthwhile at all. It doesn't even display as hex. svn path=/trunk/; revision=43908
Diffstat (limited to 'epan/dissectors/packet-ftp.c')
-rw-r--r--epan/dissectors/packet-ftp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ftp.c b/epan/dissectors/packet-ftp.c
index 364ce01cc0..062e6a3751 100644
--- a/epan/dissectors/packet-ftp.c
+++ b/epan/dissectors/packet-ftp.c
@@ -641,11 +641,14 @@ dissect_ftpdata(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ftp_data_tree = proto_item_add_subtree(ti, ett_ftp_data);
/*
- * XXX - if this is binary data, it'll produce
- * a *really* long line.
+ * tvb_format_text() is very slow for long (binary...) lines, so limit to
+ * size that will actually be displayed.
+ *
+ * Not clear if its really worth doing this for binary data, as bytes are not
+ * even shown as hex!
*/
proto_tree_add_text(ftp_data_tree, tvb, 0, data_length,
- "FTP Data: %s", tvb_format_text(tvb, 0, data_length));
+ "FTP Data: %s", tvb_format_text(tvb, 0, MIN(data_length, ITEM_LABEL_LENGTH)));
}
}