diff options
author | Dan Fandrich <dan@coneharvesters.com> | 2008-11-14 19:22:40 +0000 |
---|---|---|
committer | Dan Fandrich <dan@coneharvesters.com> | 2008-11-14 19:22:40 +0000 |
commit | 9b033e1b8a9eb81ff9468faa0e4839187ecdc568 (patch) | |
tree | ea5d8e48278db37bd744cd100237bb8fadc2ab65 | |
parent | a65ce7b107a93d0f83fc91a6b0d67c93cec4caa4 (diff) |
Added .xml as one of the few common file extensions known by the multipart
form generator. Made the extensions part of the MIME type struct to reduce
the size and run-time relocations necessary to build the table.
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | lib/formdata.c | 7 |
2 files changed, 8 insertions, 3 deletions
@@ -6,6 +6,10 @@ Changelog +Daniel Fandrich (14 Nov 2008) +- Added .xml as one of the few common file extensions known by the multipart + form generator. + Yang Tse (13 Nov 2008) - Refactored configure script detection of functions used to set sockets into non-blocking mode, and decouple function detection from function capability. diff --git a/lib/formdata.c b/lib/formdata.c index a370e65a4..483c9f82e 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -267,7 +267,7 @@ static const char * ContentTypeForFilename (const char *filename, * extensions and pick the first we match! */ struct ContentType { - const char *extension; + char extension[6]; const char *type; }; static const struct ContentType ctts[]={ @@ -275,7 +275,8 @@ static const char * ContentTypeForFilename (const char *filename, {".jpg", "image/jpeg"}, {".jpeg", "image/jpeg"}, {".txt", "text/plain"}, - {".html", "text/html"} + {".html", "text/html"}, + {".xml", "application/xml"} }; if(prevtype) @@ -1733,7 +1734,7 @@ char *Curl_FormBoundary(void) the same form won't be identical */ size_t i; - static const char table16[]="abcdef0123456789"; + static const char table16[]="0123456789abcdef"; retstring = malloc(BOUNDARY_LENGTH+1); |