feat: split route into route & query

This commit is contained in:
Jef Roosens 2023-05-27 17:14:49 +02:00
parent 7ece0eb4e5
commit 4d436aa8aa
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
5 changed files with 61 additions and 32 deletions

View file

@ -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 {

View file

@ -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);