From ef52728f7e7461cab37ee3cbc3ef9b0d7e328c65 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Sun, 28 Aug 2016 02:45:06 -0400 Subject: add header value parser, fix hashing --- include/fhp/fhp.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include/fhp') diff --git a/include/fhp/fhp.h b/include/fhp/fhp.h index 5ca48b7..46efb44 100644 --- a/include/fhp/fhp.h +++ b/include/fhp/fhp.h @@ -84,6 +84,9 @@ typedef enum { FHP_TOKEN_HEADER_VALUE_FRAGMENT, FHP_TOKEN_HEADER_VALUE_END, + FHP_TOKEN_HEADER_TRANSFER_ENCODING, + FHP_TOKEN_HEADER_CONTENT_LENGTH, + FHP_TOKEN_LAST } fhp_token_t; @@ -191,6 +194,13 @@ typedef enum { FHP_STATE_LAST } fhp_state_t; +typedef enum { + FHP_HEADER_VALUE_PARSER_NONE, + FHP_HEADER_VALUE_PARSER_TRANSFER_ENCODING, + FHP_HEADER_VALUE_PARSER_CONTENT_LENGTH, + FHP_HEADER_VALUE_PARSER_LAST +} fhp_header_value_parser_t; + #define FHP_MAX_BUF_SIZE 1024 #define FHP_MAX_TRANSFER_ENCODINGS 4 @@ -227,6 +237,13 @@ struct fhp_t_ { // hash of last header name uint32_t header_name_hash; + // header value parser + fhp_header_value_parser_t header_value_parser; + + union { + fhp_te_parser_t te; + } parsers; + // request body type fhp_body_type_t body_type; -- cgit v1.2.3