aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-http.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-02-21 18:43:14 +0100
committerAnders Broman <a.broman58@gmail.com>2015-02-24 06:47:55 +0000
commit4ee6bcbd2e03a25f1e6b0239558d9edeaf8040c0 (patch)
tree5fa662d0d3d0ab097e2b2ee053ec25fac409d66b /epan/dissectors/packet-http.c
parentc466d401d9c41c837010f8c4b9da22727577192b (diff)
websocket: avoid recursion, use tcp_dissect_pdus
Use tcp_dissect_pdus to handle reassembly and avoid a recursion in dissect_websocket. The HTTP dissector is modified to preserve desegmentation functionality (tested with the capture from bug 8448). As tcp_dissect_pdus is used now, the workaround for bug 8448 can be removed and the actual frame dissection logic becomes simpler (the length is checked in get_websocket_frame_length). Bug: 10989 Change-Id: I67af96a6c7be88c2a77e1c4138abe90bdb880774 Reviewed-on: https://code.wireshark.org/review/7285 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-http.c')
-rw-r--r--epan/dissectors/packet-http.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index 50f9306262..02ea8d4cd6 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -2910,6 +2910,10 @@ dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
} else {
while (tvb_reported_length_remaining(tvb, offset) > 0) {
if (conv_data->upgrade == UPGRADE_WEBSOCKET && pinfo->fd->num >= conv_data->startframe) {
+ /* Websockets is a stream of data, preserve
+ * desegmentation functionality. */
+ if (pinfo->can_desegment > 0)
+ pinfo->can_desegment++;
call_dissector_only(websocket_handle, tvb_new_subset_remaining(tvb, offset), pinfo, tree, NULL);
break;
}