aboutsummaryrefslogtreecommitdiff
path: root/picohttp.h
diff options
context:
space:
mode:
authorWolfgang Draxinger <Wolfgang.Draxinger@physik.uni-muenchen.de>2013-03-08 20:08:35 +0100
committerWolfgang Draxinger <Wolfgang.Draxinger@physik.uni-muenchen.de>2013-03-08 20:08:35 +0100
commit720a430b3d9cc87512f1625e6d78391480dfb062 (patch)
tree4928bb840034d4396d95066719ef2bdbafc8f9ec /picohttp.h
parentdfb3c1ca13a828405503d6ec2ee3979ae825326b (diff)
downloadlitheweb-720a430b3d9cc87512f1625e6d78391480dfb062.tar.gz
litheweb-720a430b3d9cc87512f1625e6d78391480dfb062.tar.bz2
Fri Mar 8 20:08:35 CET 2013
Diffstat (limited to 'picohttp.h')
-rw-r--r--picohttp.h29
1 files changed, 23 insertions, 6 deletions
diff --git a/picohttp.h b/picohttp.h
index cceee44..9df3596 100644
--- a/picohttp.h
+++ b/picohttp.h
@@ -14,7 +14,7 @@
struct picohttpIoOps {
int (*read)(size_t /*count*/, char* /*buf*/, void*);
- int (*write)(size_t /*count*/, char* /*buf*/, void*);
+ int (*write)(size_t /*count*/, char const* /*buf*/, void*);
int16_t (*getch)(void*); // returns -1 on error
int (*putch)(char, void*);
void *data;
@@ -52,24 +52,41 @@ struct picohttpVar {
struct picohttpRequest;
-typedef void (*picohttpHandler) (struct picohttpRequest *ctx);
+typedef void (*picohttpHandler)(struct picohttpRequest*);
struct picohttpURLRoute {
char const * urlhead;
struct picohttpVarSpec const * get_vars;
picohttpHandler handler;
uint16_t max_urltail_len;
- uint8_t allowed_methods;
+ int16_t allowed_methods;
};
struct picohttpRequest {
struct picohttpIoOps const * ioops;
- struct picohttpURLRoute *route;
+ struct picohttpURLRoute const * route;
struct picohttpVar *get_vars;
char const *url;
char const *urltail;
- int16_t httpversion;
- uint8_t method;
+ int16_t status;
+ int16_t method;
+ struct {
+ uint8_t major;
+ uint8_t minor;
+ } httpversion;
+ struct {
+ uint8_t encoding;
+ char const *contenttype;
+ size_t contentlength;
+ } queryheader;
+ struct {
+ uint8_t encoding;
+ char const *contenttype;
+ char const *date;
+ char const *cachecontrol;
+ char const *disposition;
+ size_t contentlength;
+ } responseheader;
};
void picohttpProcessRequest(