From e69874791daf88461c6813e5133bf775055ea2bf Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sun, 28 Aug 2016 03:38:59 -0400 Subject: add cl_parser test --- include/fhp/fhp.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'include/fhp') diff --git a/include/fhp/fhp.h b/include/fhp/fhp.h index 1e32a0d..2739bc9 100644 --- a/include/fhp/fhp.h +++ b/include/fhp/fhp.h @@ -120,7 +120,7 @@ void fhp_env_init(fhp_env_t * const env); fhp_env_t *fhp_get_default_env(void); // -// content length parser functions +// content-length parser functions // typedef enum { @@ -138,8 +138,17 @@ typedef struct { uint64_t val; } fhp_cl_parser_t; +fhp_err_t +fhp_cl_parser_init(fhp_cl_parser_t * const); + +fhp_err_t +fhp_cl_parser_push(fhp_cl_parser_t *, uint8_t * const, size_t); + +fhp_err_t +fhp_cl_parser_done(fhp_cl_parser_t * const, uint64_t * const); + // -// transfer encoding parser functions +// transfer-encoding parser functions // typedef enum { @@ -170,7 +179,7 @@ typedef struct { } fhp_te_parser_t; fhp_err_t -fhp_te_parser_init(fhp_te_parser_t * const te); +fhp_te_parser_init(fhp_te_parser_t * const); fhp_err_t fhp_te_parser_push(fhp_te_parser_t *, uint8_t * const, size_t); @@ -267,6 +276,7 @@ struct fhp_t_ { union { fhp_te_parser_t te; + fhp_cl_parser_t cl; } parsers; // request body type -- cgit v1.2.3