aboutsummaryrefslogtreecommitdiff
path: root/picohttp.c
diff options
context:
space:
mode:
authorWolfgang Draxinger <Wolfgang.Draxinger@physik.uni-muenchen.de>2013-06-20 16:55:28 +0200
committerWolfgang Draxinger <Wolfgang.Draxinger@physik.uni-muenchen.de>2013-06-20 16:55:28 +0200
commitef400acf33b32092c6c4c76f91a44d0a38061d0f (patch)
tree1763738d6c2710e809fc0f84769131d275eb3b4a /picohttp.c
parentc50c12e6206772273f62752c1c0091ac78698665 (diff)
downloadlitheweb-ef400acf33b32092c6c4c76f91a44d0a38061d0f.tar.gz
litheweb-ef400acf33b32092c6c4c76f91a44d0a38061d0f.tar.bz2
...
Diffstat (limited to 'picohttp.c')
-rw-r--r--picohttp.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/picohttp.c b/picohttp.c
index f7b6948..957bfa6 100644
--- a/picohttp.c
+++ b/picohttp.c
@@ -1,5 +1,11 @@
#include "picohttp.h"
+#define picohttpIoWrite(ioops,size,buf) (ioops->write(size, buf, ioops->data))
+#define picohttpIoRead(ioops,size,buf) (ioops->read(size, buf, ioops->data))
+#define picohttpIoGetch(ioops) (ioops->getch(ioops->data))
+#define picohttpIoPutch(ioops,c) (ioops->putch(c, ioops->data))
+#define picohttpIoFlush(ioops) (ioops->flush(ioops->data))
+
#ifdef HOST_DEBUG
#include <stdio.h>
#define debug_printf(...) do{fprintf(stderr, __VA_ARGS__);}while(0)
@@ -446,6 +452,7 @@ static int16_t picohttpProcessQuery (
ch = picohttpIoGetch(req->ioops);
}
if( '=' == ch ) {
+ debug_printf("set variable '%s'\n", var);
} else {
}
}
@@ -522,15 +529,18 @@ static void picohttpProcessContentType(
if(!strncmp(contenttype, PICOHTTP_STR_MULTIPART_,
sizeof(PICOHTTP_STR_MULTIPART_)-1)) {
- req->query.contenttype.type = PICOHTTP_CONTENTTYPE_MULTIPART;
contenttype += sizeof(PICOHTTP_STR_MULTIPART_)-1;
+ req->query.contenttype =
+ PICOHTTP_CONTENTTYPE_MULTIPART;
if(!strncmp(contenttype,PICOHTTP_STR_FORMDATA,
sizeof(PICOHTTP_STR_FORMDATA)-1)) {
- req->query.contenttype.subtype =
- PICOHTTP_CONTENTTYPE_MULTIPART_SUBTYPE_FORM_DATA;
contenttype += sizeof(PICOHTTP_STR_FORMDATA)-1;
+
+ req->query.contenttype =
+ PICOHTTP_CONTENTTYPE_MULTIPART_FORMDATA;
}
+
char *boundary = strstr(contenttype, PICOHTTP_STR_BOUNDARY);
if(boundary) {
/* see RFC1521 regarding maximum length of boundary */