diff options
Diffstat (limited to 'epan')
-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); |