feat: basic http routing
This commit is contained in:
parent
8250a5b8b0
commit
7ece0eb4e5
4 changed files with 75 additions and 31 deletions
|
|
@ -16,15 +16,15 @@ typedef struct http_route {
|
|||
http_route_type type;
|
||||
char *path;
|
||||
regex_t *regex;
|
||||
size_t step_count;
|
||||
void (**steps)(event_loop_conn *);
|
||||
bool (*steps[5])(event_loop_conn *);
|
||||
} http_route;
|
||||
|
||||
/*
|
||||
* Global context passed to every connection using the same pointer
|
||||
*/
|
||||
typedef struct http_loop_gctx {
|
||||
http_route **routes;
|
||||
http_route *routes;
|
||||
size_t route_count;
|
||||
Trie *trie;
|
||||
} http_loop_gctx;
|
||||
|
||||
|
|
@ -58,6 +58,8 @@ void http_loop_ctx_free(http_loop_ctx *ctx);
|
|||
*/
|
||||
bool http_loop_handle_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