diff options
author | Wolfgang Draxinger <Wolfgang.Draxinger@physik.uni-muenchen.de> | 2013-03-12 20:13:53 +0100 |
---|---|---|
committer | Wolfgang Draxinger <Wolfgang.Draxinger@physik.uni-muenchen.de> | 2013-03-12 20:13:53 +0100 |
commit | 5ff179fad970eb0a878a27511d6c90419bac2cdf (patch) | |
tree | 1d639f92585d55831353115ef607dd899dc9930e /picohttp.h | |
parent | 62d44c3e46f63c891b18d05be5fbfa3c4a57feb5 (diff) | |
download | litheweb-5ff179fad970eb0a878a27511d6c90419bac2cdf.tar.gz litheweb-5ff179fad970eb0a878a27511d6c90419bac2cdf.tar.bz2 |
Tue Mar 12 20:13:53 CET 2013
Diffstat (limited to 'picohttp.h')
-rw-r--r-- | picohttp.h | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -18,11 +18,21 @@ #define PICOHTTP_CODING_GZIP 4 #define PICOHTTP_CODING_CHUNKED 8 +#define PICOHTTP_STATUS_200_OK 200 +#define PICOHTTP_STATUS_400_BAD_REQUEST 400 +#define PICOHTTP_STATUS_404_NOT_FOUND 404 +#define PICOHTTP_STATUS_405_METHOD_NOT_ALLOWED 405 +#define PICOHTTP_STATUS_414_REQUEST_URI_TOO_LONG 414 +#define PICOHTTP_STATUS_500_INTERNAL_SERVER_ERROR 500 +#define PICOHTTP_STATUS_501_NOT_IMPLEMENTED 501 +#define PICOHTTP_STATUS_505_HTTP_VERSION_NOT_SUPPORTED 505 + struct picohttpIoOps { int (*read)(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*); + int (*flush)(void*); void *data; }; @@ -30,6 +40,7 @@ struct picohttpIoOps { #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)) enum picohttpVarType { PICOHTTP_TYPE_UNDEFINED = 0, @@ -85,7 +96,7 @@ struct picohttpRequest { size_t contentlength; uint8_t contentcoding; uint8_t te; - } queryheader; + } query; struct { char const *contenttype; char const *date; @@ -94,7 +105,7 @@ struct picohttpRequest { size_t contentlength; uint8_t contentencoding; uint8_t transferencoding; - } responseheader; + } response; struct { size_t octets; uint8_t header; |