#pragma once #include #include "connection.h" struct span { int start; int length; }; struct request { int (* step)(lua_State *, struct request *); char * data; int length; int position; struct span temp; int expected_data_length; }; struct request * new_request(void); void free_request(struct request *); int parse_request(struct connection *); int parse_step_method(lua_State *, struct request *); int parse_step_path(lua_State *, struct request *); int parse_step_version(lua_State *, struct request *); int parse_step_header_name(lua_State *, struct request *); int parse_step_header_value(lua_State *, struct request *); int parse_step_data(lua_State *, struct request *);