aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-http-urlencoded.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-08-21 23:33:23 -0700
committerGuy Harris <guy@alum.mit.edu>2016-08-22 06:34:06 +0000
commit5825f59ddccb8af2b4a06356f61195dd26c977d7 (patch)
tree5250e297808ccc0dd7dd36c688dbba8d53368c75 /epan/dissectors/packet-http-urlencoded.c
parentefdcb25360621e5ac14f276b37964f27f4ce0ba4 (diff)
Pass an HTTP message type to all HTTP subdissectors.
This gets complicated, because those subdissectors might be called by other dissectors as well. We need a better way of passing that sort of out-of-bound information. Pull some routines used for processing Content-Type parameters into common code; we can't guarantee that the media parameters passed in would be writable (passing it as *the* data hid that; passing a structure with that *and* the HTTP message type revealed it), so don't convert it to lower-case in place. Use that information, if available, to determine whether an IPP message is a requet or a response. Change-Id: I4bccc9f05cd0b14ad445be7ab37b3d884d841325 Reviewed-on: https://code.wireshark.org/review/17216 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-http-urlencoded.c')
-rw-r--r--epan/dissectors/packet-http-urlencoded.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/epan/dissectors/packet-http-urlencoded.c b/epan/dissectors/packet-http-urlencoded.c
index aca2185aaa..46f49e624b 100644
--- a/epan/dissectors/packet-http-urlencoded.c
+++ b/epan/dissectors/packet-http-urlencoded.c
@@ -27,6 +27,8 @@
#include <epan/packet.h>
#include <wsutil/str_util.h>
+#include "packet-http.h"
+
void proto_register_http_urlencoded(void);
void proto_reg_handoff_http_urlencoded(void);
@@ -123,18 +125,27 @@ dissect_form_urlencoded(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, voi
proto_item *ti;
gint offset = 0, next_offset;
const char *data_name;
+ http_message_info_t *message_info;
data_name = pinfo->match_string;
if (! (data_name && data_name[0])) {
/*
* No information from "match_string"
*/
- data_name = (char *)data;
- if (! (data_name && data_name[0])) {
+ message_info = (http_message_info_t *)data;
+ if (message_info == NULL) {
/*
* No information from dissector data
*/
data_name = NULL;
+ } else {
+ data_name = message_info->media_str;
+ if (! (data_name && data_name[0])) {
+ /*
+ * No information from dissector data
+ */
+ data_name = NULL;
+ }
}
}