aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-http2.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2018-08-12 18:51:10 +0200
committerAnders Broman <a.broman58@gmail.com>2018-08-13 08:20:35 +0000
commitca75c14f05777f2aa35f3c69aa547822bcc6081b (patch)
treefdca5559015d8e266af1a5c719de7fba4a4a6668 /epan/dissectors/packet-http2.c
parent3a9f1717634a331507e9ccae74108fd9e3c1222a (diff)
HTTP: create dissector table for HTTP Upgrade
Based on an idea from David M. Lloyd, let subdissectors register themselves with the HTTP dissector based on the Upgrade header instead of the other way round. Tested with SSTP (bug 82390), WebSocket (bug 13889), HTTP2 PRI without Upgrade (bug 11331), h2c (from HTTP2 wiki), spdy/3.1 (bug 12874). Change-Id: I1425b7119d4d85e626032408504fc2c6b2f2eeb8 Reviewed-on: https://code.wireshark.org/review/29112 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-http2.c')
-rw-r--r--epan/dissectors/packet-http2.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/epan/dissectors/packet-http2.c b/epan/dissectors/packet-http2.c
index ba5c8abeee..77683d5bdd 100644
--- a/epan/dissectors/packet-http2.c
+++ b/epan/dissectors/packet-http2.c
@@ -3347,10 +3347,11 @@ proto_reg_handoff_http2(void)
dissector_add_for_decode_as_with_preference("tcp.port", http2_handle);
/*
- * SSL/TLS Application-Layer Protocol Negotiation (ALPN) protocol
- * ID.
+ * SSL/TLS Application-Layer Protocol Negotiation (ALPN) protocol ID.
*/
dissector_add_string("ssl.handshake.extensions_alpn_str", "h2", http2_handle);
+ dissector_add_string("http.upgrade", "h2", http2_handle);
+ dissector_add_string("http.upgrade", "h2c", http2_handle);
heur_dissector_add("ssl", dissect_http2_heur_ssl, "HTTP2 over SSL", "http2_ssl", proto_http2, HEURISTIC_ENABLE);
heur_dissector_add("http", dissect_http2_heur, "HTTP2 over TCP", "http2_tcp", proto_http2, HEURISTIC_ENABLE);