diff options
author | Peter Wu <peter@lekensteyn.nl> | 2015-09-16 11:06:00 +0200 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2015-09-16 13:32:20 +0000 |
commit | d67e20a93383889ee8e0436758d26b7e98d8a200 (patch) | |
tree | a89cc1a13156de93b260dcaea7497489fa16329a | |
parent | a825476439d902990048aafc8114396b8aa33df2 (diff) |
http: preserve desegmentation functionality for http2
When the HTTP dissector passes data to a subdissector, it should also
propagate the desegmentation ability. Otherwise subdissectors (such as
HTTP2) will not be able to handle large DATA frames.
Reported by Alexis, verified with his capture.
Change-Id: I831a78e8d1ad08536e3d0d870012e427ce289b1b
Reviewed-on: https://code.wireshark.org/review/10544
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
-rw-r--r-- | epan/dissectors/packet-http.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c index 500248b9cf..877e783c3d 100644 --- a/epan/dissectors/packet-http.c +++ b/epan/dissectors/packet-http.c @@ -2901,12 +2901,15 @@ dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) int offset = 0; int len; conversation_t *conversation; + dissector_handle_t next_handle = NULL; conv_data = get_http_conversation_data(pinfo, &conversation); /* Call HTTP2 dissector directly when detected via heuristics, but not * when it was upgraded (the conversation started with HTTP). */ if (conversation_get_proto_data(conversation, proto_http2) && conv_data->upgrade != UPGRADE_HTTP2) { + if (pinfo->can_desegment > 0) + pinfo->can_desegment++; return call_dissector_only(http2_handle, tvb, pinfo, tree, NULL); } @@ -2925,18 +2928,15 @@ 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; + next_handle = websocket_handle; } if (conv_data->upgrade == UPGRADE_HTTP2 && pinfo->fd->num >= conv_data->startframe) { - call_dissector_only(http2_handle, tvb_new_subset_remaining(tvb, offset), pinfo, tree, NULL); - break; + next_handle = http2_handle; } if (conv_data->upgrade == UPGRADE_SSTP && conv_data->response_code == 200 && pinfo->fd->num >= conv_data->startframe) { + next_handle = sstp_handle; + } + if (next_handle) { /* Increase pinfo->can_desegment because we are traversing * http and want to preserve desegmentation functionality for * the proxied protocol @@ -2944,7 +2944,7 @@ dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) if (pinfo->can_desegment > 0) pinfo->can_desegment++; - call_dissector_only(sstp_handle, tvb_new_subset_remaining(tvb, offset), pinfo, tree, NULL); + call_dissector_only(next_handle, tvb_new_subset_remaining(tvb, offset), pinfo, tree, NULL); break; } len = dissect_http_message(tvb, offset, pinfo, tree, conv_data); |