summaryrefslogtreecommitdiff
path: root/epan
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-08-01 11:27:09 -0700
committerGuy Harris <guy@alum.mit.edu>2015-08-01 18:28:14 +0000
commit711edcfa84aa670e9aa1b72de7285d392e6c9c79 (patch)
tree04e1c59d11c7a649c1c2674c2ff292f1747d7cdd /epan
parent86a8b9c4b2e1679cf6bf9754d9afe71e412a18f8 (diff)
downloadwireshark-711edcfa84aa670e9aa1b72de7285d392e6c9c79.tar.gz
Set the reported length of chunk data correctly.
The reported length should be the size of the chunk, not the remaining size of dechunked data. Update some comments while we're at it. Change-Id: Ia71948fb5ecebdaae3e171c53fd88cf72dcf76a3 Reviewed-on: https://code.wireshark.org/review/9846 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-http.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index 5ba60c8e02..e47fb13891 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -1642,7 +1642,7 @@ basic_response_dissector(tvbuff_t *tvb, proto_tree *tree, int offset,
}
-#if 0 /* XXX: Replaced by code creating the "Dechunked" tvb O(N) rather tan O(N^2) */
+#if 0 /* XXX: Replaced by code creating the "Dechunked" tvb O(N) rather than O(N^2) */
/*
* Dissect the http data chunks and add them to the tree.
*/
@@ -1772,16 +1772,15 @@ chunked_encoding_dissector(tvbuff_t **tvb_ptr, packet_info *pinfo,
1, chunk_size, "%u octets", chunk_size);
proto_item_set_len(chuck_size_item, chunk_offset - offset);
- data_tvb = tvb_new_subset_length(tvb, chunk_offset, chunk_size);
-
-
/*
- * XXX - just use "proto_tree_add_string_format()"?
- * This means that, in TShark, you get
- * the entire chunk dumped out in hex,
- * in addition to whatever dissection is
- * done on the reassembled data.
+ * XXX - just add the chunk's data as an item?
+ *
+ * Using the data dissector means that, in
+ * TShark, you get the entire chunk dumped
+ * out in hex, in addition to whatever
+ * dissection is done on the reassembled data.
*/
+ data_tvb = tvb_new_subset_length(tvb, chunk_offset, chunk_size);
call_dissector(data_handle, data_tvb, pinfo,
chunk_subtree);
@@ -1928,15 +1927,15 @@ chunked_encoding_dissector(tvbuff_t **tvb_ptr, packet_info *pinfo,
/* last-chunk does not have chunk-data CRLF. */
if (chunk_size > 0) {
- data_tvb = tvb_new_subset(tvb, chunk_offset, chunk_size, datalen);
-
/*
- * XXX - just use "proto_tree_add_string_format()"?
- * This means that, in TShark, you get
- * the entire chunk dumped out in hex,
- * in addition to whatever dissection is
- * done on the reassembled data.
+ * XXX - just add the chunk's data as an item?
+ *
+ * Using the data dissector means that, in
+ * TShark, you get the entire chunk dumped
+ * out in hex, in addition to whatever
+ * dissection is done on the reassembled data.
*/
+ data_tvb = tvb_new_subset_length(tvb, chunk_offset, chunk_size);
call_dissector(data_handle, data_tvb, pinfo,
chunk_subtree);