aboutsummaryrefslogtreecommitdiff
path: root/picohttp.h
diff options
context:
space:
mode:
authorWolfgang Draxinger <Wolfgang.Draxinger@draxit.de>2013-06-18 22:14:56 +0200
committerWolfgang Draxinger <Wolfgang.Draxinger@draxit.de>2013-06-18 22:14:56 +0200
commitd8b0fcee5325f54ba48531d265f5d9823ebed9f3 (patch)
treeaa9eeceaec6b5d8e3b52dbe82f0d4f0c38630f0d /picohttp.h
parente7b86baeec0ef6f946e2b60a68876eb6f3cdc32e (diff)
parent3293d9eeed04c67669c06bc745ea9ee05012cb7f (diff)
downloadlitheweb-d8b0fcee5325f54ba48531d265f5d9823ebed9f3.tar.gz
litheweb-d8b0fcee5325f54ba48531d265f5d9823ebed9f3.tar.bz2
Merge branch 'master' of github.com:datenwolf/picoweb
Diffstat (limited to 'picohttp.h')
-rw-r--r--picohttp.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/picohttp.h b/picohttp.h
index 24212e5..568f6b8 100644
--- a/picohttp.h
+++ b/picohttp.h
@@ -5,6 +5,8 @@
#include <stddef.h>
#include <stdint.h>
+#define PICOHTTP_MULTIPARTBOUNDARY_MAX_LEN 70
+
#define PICOHTTP_MAJORVERSION(x) ( (x & 0x7f00) >> 8 )
#define PICOHTTP_MINORVERSION(x) ( (x & 0x007f) )
@@ -12,6 +14,21 @@
#define PICOHTTP_METHOD_HEAD 2
#define PICOHTTP_METHOD_POST 3
+#define PICOHTTP_CONTENTTYPE_APPLICATION 0
+#define PICOHTTP_CONTENTTYPE_AUDIO 1
+#define PICOHTTP_CONTENTTYPE_IMAGE 2
+#define PICOHTTP_CONTENTTYPE_MESSAGE 3
+#define PICOHTTP_CONTENTTYPE_MODEL 4
+#define PICOHTTP_CONTENTTYPE_MULTIPART 5
+#define PICOHTTP_CONTENTTYPE_TEXT 6
+#define PICOHTTP_CONTENTTYPE_VIDEO 7
+
+#define PICOHTTP_CONTENTTYPE_TEXT_SUBTYPE_CSV 3
+#define PICOHTTP_CONTENTTYPE_TEXT_SUBTYPE_HTML 4
+#define PICOHTTP_CONTENTTYPE_TEXT_SUBTYPE_PLAIN 6
+
+#define PICOHTTP_CONTENTTYPE_MULTIPART_SUBTYPE_FORM_DATA 4
+
#define PICOHTTP_CODING_IDENTITY 0
#define PICOHTTP_CODING_COMPRESS 1
#define PICOHTTP_CODING_DEFLATE 2
@@ -103,10 +120,14 @@ struct picohttpRequest {
uint8_t minor;
} httpversion;
struct {
- char const *contenttype;
+ struct {
+ uint16_t type:4;
+ uint16_t subtype:12;
+ } contenttype;
size_t contentlength;
- uint8_t contentcoding;
+ uint8_t contentencoding;
uint8_t te;
+ char multipartboundary[PICOHTTP_MULTIPARTBOUNDARY_MAX_LEN+1];
} query;
struct {
char const *contenttype;