summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-http.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-09-16 00:29:00 +0200
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2015-09-16 06:05:39 +0000
commit2c7c7051575ecc1a0007d07d64816682c3c8c470 (patch)
tree70251a19e39a05e2bbead12597dcb7cf33760470 /epan/dissectors/packet-http.c
parentc36ed56abedb3275a9529eb51f8adca807e199c9 (diff)
downloadwireshark-2c7c7051575ecc1a0007d07d64816682c3c8c470.tar.gz
http2: fix dissection when using Upgrade
The fix for bug 11331 has as side-effect that the HTTP part of a conversation is not dissected on the second pass. Fix it by calling the HTTP2 dissector only when it was detected via heuristics, and not via Upgrade (since that would be handled by the http loop). While at it, remove the use of tvb_new_subset_remaining since the original tvb is not touched and move the comment about the proxy to the right place. Tested with the capture from Alexis (plain HTTP2 via Upgrade), the one from bug 11331 (plain HTTP2 via heuristics) and a HTTP2 in SSL capture (via heuristics). Change-Id: Iead7682aa8d5114e4edcfd54eabcd0d659056cc1 Reviewed-on: https://code.wireshark.org/review/10541 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-http.c')
-rw-r--r--epan/dissectors/packet-http.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c
index 00e5e85a0a..500248b9cf 100644
--- a/epan/dissectors/packet-http.c
+++ b/epan/dissectors/packet-http.c
@@ -2902,16 +2902,18 @@ dissect_http(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
int len;
conversation_t *conversation;
+ 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) {
+ return call_dissector_only(http2_handle, tvb, pinfo, tree, NULL);
+ }
+
/*
* Check if this is proxied connection and if so, hand of dissection to the
* payload-dissector.
* Response code 200 means "OK" and strncmp() == 0 means the strings match exactly */
- conv_data = get_http_conversation_data(pinfo, &conversation);
- if (conversation_get_proto_data(conversation, proto_http2)) {
- /* HTTP2 heuristic dissector already identified this conversation as being HTTP2 traffic.
- Call sub dissector directly. */
- return call_dissector_only(http2_handle, tvb_new_subset_remaining(tvb, offset), pinfo, tree, NULL);
- }
if(pinfo->fd->num >= conv_data->startframe &&
conv_data->response_code == 200 &&
conv_data->request_method &&