feat: split route into route & query
This commit is contained in:
parent
7ece0eb4e5
commit
4d436aa8aa
5 changed files with 61 additions and 32 deletions
|
|
@ -34,6 +34,8 @@ typedef struct http_request {
|
|||
size_t method_len;
|
||||
const char *path;
|
||||
size_t path_len;
|
||||
const char *query;
|
||||
size_t query_len;
|
||||
struct phr_header headers[HTTP_MAX_ALLOWED_HEADERS];
|
||||
} http_request;
|
||||
|
||||
|
|
@ -43,9 +45,6 @@ typedef enum http_parse_error {
|
|||
http_parse_error_invalid = 2,
|
||||
} http_parse_error;
|
||||
|
||||
http_parse_error http_parse_request(http_request *req, const char *path,
|
||||
size_t path_len);
|
||||
|
||||
/* void http_route(event_loop_conn *conn); */
|
||||
|
||||
typedef enum http_response_type {
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ void http_loop_ctx_free(http_loop_ctx *ctx);
|
|||
*/
|
||||
bool http_loop_handle_request(event_loop_conn *conn);
|
||||
|
||||
http_parse_error http_loop_parse_request(event_loop_conn *conn);
|
||||
|
||||
bool http_loop_route_request(event_loop_conn *conn);
|
||||
|
||||
void http_loop_process_request(event_loop_conn *conn);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue