feat: started designing http framework

This commit is contained in:
Jef Roosens 2023-05-27 15:38:06 +02:00
parent 90d83bc5d4
commit 8250a5b8b0
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
9 changed files with 96 additions and 50 deletions

View file

@ -31,7 +31,7 @@ bool http_loop_handle_request(event_loop_conn *conn) {
if (res == http_parse_error_ok) {
// Perform the request
http_route(conn);
/* http_route(conn); */
}
// Both in the case of an invalid HTTP request or one that's larger than the
// read buffer, we cannot determine when the next, possibly valid, HTTP

View file

@ -3,11 +3,11 @@
#include "event_loop.h"
#include "http.h"
typedef void (*routing_func)(event_loop_conn *);
void http_loop_process_request(event_loop_conn *conn) {}
void http_route(event_loop_conn *conn) {
// TODO routing
/* void http_route(event_loop_conn *conn) { */
/* // TODO routing */
// Fallthrough is to return a 404
http_write_standard_response(conn, http_not_found);
}
/* // Fallthrough is to return a 404 */
/* http_write_standard_response(conn, http_not_found); */
/* } */