feat: add context information to requests

This commit is contained in:
Jef Roosens 2023-05-26 22:12:53 +02:00
parent 6d4b94c55e
commit dfd27b579d
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
8 changed files with 241 additions and 183 deletions

View file

@ -1,5 +1,17 @@
#include <string.h>
#include "event_loop.h"
#include "http.h"
typedef void (*routing_func)(event_loop_conn *);
routing_func http_route();
void http_route(event_loop_conn *conn) {
// TODO routing
// Fallthrough is to return a 404
memcpy(conn->wbuf, http_404, http_404_len);
conn->state = event_loop_conn_state_res;
conn->wbuf_size = http_404_len;
conn->wbuf_sent = 0;
}