diff options
author | Guy Harris <guy@alum.mit.edu> | 2005-01-20 01:26:34 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2005-01-20 01:26:34 +0000 |
commit | 2b7ca484ace0264f11cf30e5dd3e1c7c78a5530e (patch) | |
tree | e208da4d56448b7fce55c5ef4fb20cc93a53adce /epan | |
parent | 39a6232a8d48ea6f85c3506f5282b6a03616d383 (diff) | |
download | wireshark-2b7ca484ace0264f11cf30e5dd3e1c7c78a5530e.tar.gz |
From Ruud Linders: support short names in multipart headers; SIP-T
requires this.
svn path=/trunk/; revision=13127
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-multipart.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/epan/dissectors/packet-multipart.c b/epan/dissectors/packet-multipart.c index 12d2f2f90b..64afba27b1 100644 --- a/epan/dissectors/packet-multipart.c +++ b/epan/dissectors/packet-multipart.c @@ -89,13 +89,18 @@ static gint ett_multipart_body = -1; * the structure from SIP dissector, all the content- is also from SIP */ -static const char *multipart_headers[] = { - "Unknown-header", /* Pad so that the real headers start at index 1 */ - "Content-Disposition", - "Content-Encoding", - "Content-Language", - "Content-Length", - "Content-Type", +typedef struct { + char *name; + char *compact_name; +} multipart_header_t; + +static const multipart_header_t multipart_headers[] = { + { "Unknown-header", NULL }, /* Pad so that the real headers start at index 1 */ + { "Content-Disposition", NULL }, + { "Content-Encoding", "e" }, + { "Content-Language", NULL }, + { "Content-Length", "l" }, + { "Content-Type", "c" }, }; #define POS_CONTENT_DISPOSITION 1 @@ -786,10 +791,13 @@ is_known_multipart_header(const char *header_str, guint len) guint i; for (i = 1; i < array_length(multipart_headers); i++) { - if (len == strlen(multipart_headers[i]) && - strncasecmp(header_str, multipart_headers[i], len) == 0) { + if (len == strlen(multipart_headers[i].name) && + strncasecmp(header_str, multipart_headers[i].name, len) == 0) + return i; + if (multipart_headers[i].compact_name != NULL && + len == strlen(multipart_headers[i].compact_name) && + strncasecmp(header_str, multipart_headers[i].compact_name, len) == 0) return i; - } } return -1; |