feat: started designing http framework
This commit is contained in:
parent
90d83bc5d4
commit
8250a5b8b0
9 changed files with 96 additions and 50 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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); */
|
||||
/* } */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue